(pytester: Pytester)
| 1328 | |
| 1329 | |
| 1330 | def test_assertrepr_loaded_per_dir(pytester: Pytester) -> None: |
| 1331 | pytester.makepyfile(test_base=["def test_base(): assert 1 == 2"]) |
| 1332 | a = pytester.mkdir("a") |
| 1333 | a.joinpath("test_a.py").write_text("def test_a(): assert 1 == 2") |
| 1334 | a.joinpath("conftest.py").write_text( |
| 1335 | 'def pytest_assertrepr_compare(): return ["summary a"]' |
| 1336 | ) |
| 1337 | b = pytester.mkdir("b") |
| 1338 | b.joinpath("test_b.py").write_text("def test_b(): assert 1 == 2") |
| 1339 | b.joinpath("conftest.py").write_text( |
| 1340 | 'def pytest_assertrepr_compare(): return ["summary b"]' |
| 1341 | ) |
| 1342 | |
| 1343 | result = pytester.runpytest() |
| 1344 | result.stdout.fnmatch_lines( |
| 1345 | [ |
| 1346 | "*def test_base():*", |
| 1347 | "*E*assert 1 == 2*", |
| 1348 | "*def test_a():*", |
| 1349 | "*E*assert summary a*", |
| 1350 | "*def test_b():*", |
| 1351 | "*E*assert summary b*", |
| 1352 | ] |
| 1353 | ) |
| 1354 | |
| 1355 | |
| 1356 | def test_assertion_options(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected