Skip to content

Commit 61ef3e6

Browse files
assertion only warns about imp on python3
1 parent 388357d commit 61ef3e6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

testing/test_own_modules.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
import _pytest
66
import pytest
77

8-
KNOWN_BAD = {"_pytest.assertion"}
8+
KNOWN_BAD = {
9+
"_pytest.assertion": [
10+
pytest.mark.xfail("sys.version_info[0]==3", reason="assertion uses imp")
11+
]
12+
}
913

1014

1115
def _get_modules():
1216
for module in vars(_pytest).values():
1317
if isinstance(module, types.ModuleType):
1418
name = module.__name__
15-
marks = (
16-
[pytest.mark.xfail(reason="known failure")] if name in KNOWN_BAD else []
17-
)
18-
yield pytest.param(name, marks=marks)
19+
yield pytest.param(name, marks=KNOWN_BAD.get(name, []))
1920

2021

2122
@pytest.mark.parametrize("module_name", sorted(_get_modules()))

0 commit comments

Comments
 (0)