MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_assertrepr_loaded_per_dir

Function test_assertrepr_loaded_per_dir

testing/test_assertion.py:1330–1353  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1328
1329
1330def 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
1356def test_assertion_options(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
mkdirMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected