Move WarningsChecker import in test to a local import to workaround flakes issue
See #897 for discussion
This commit is contained in:
parent
d761bfffd7
commit
02e742b7a6
|
@ -1,7 +1,7 @@
|
||||||
import warnings
|
import warnings
|
||||||
import py
|
import py
|
||||||
import pytest
|
import pytest
|
||||||
from _pytest.recwarn import WarningsChecker, WarningsRecorder
|
from _pytest.recwarn import WarningsRecorder
|
||||||
|
|
||||||
|
|
||||||
def test_recwarn_functional(testdir):
|
def test_recwarn_functional(testdir):
|
||||||
|
@ -42,6 +42,7 @@ class TestWarningsRecorderChecker(object):
|
||||||
assert showwarning == py.std.warnings.showwarning
|
assert showwarning == py.std.warnings.showwarning
|
||||||
|
|
||||||
def test_typechecking(self):
|
def test_typechecking(self):
|
||||||
|
from _pytest.recwarn import WarningsChecker
|
||||||
with pytest.raises(TypeError):
|
with pytest.raises(TypeError):
|
||||||
WarningsChecker(5)
|
WarningsChecker(5)
|
||||||
with pytest.raises(TypeError):
|
with pytest.raises(TypeError):
|
||||||
|
|
Loading…
Reference in New Issue