Skip to content

Commit 02e742b

Browse files
committed
Move WarningsChecker import in test to a local import to workaround flakes issue
See pytest-dev#897 for discussion
1 parent d761bff commit 02e742b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

testing/test_recwarn.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import warnings
22
import py
33
import pytest
4-
from _pytest.recwarn import WarningsChecker, WarningsRecorder
4+
from _pytest.recwarn import WarningsRecorder
55

66

77
def test_recwarn_functional(testdir):
@@ -42,6 +42,7 @@ def test_recording(self, recwarn):
4242
assert showwarning == py.std.warnings.showwarning
4343

4444
def test_typechecking(self):
45+
from _pytest.recwarn import WarningsChecker
4546
with pytest.raises(TypeError):
4647
WarningsChecker(5)
4748
with pytest.raises(TypeError):

0 commit comments

Comments
 (0)