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

Function test_pytest_assertrepr_compare_integration

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

Source from the content-addressed store, hash-verified

1284
1285
1286def test_pytest_assertrepr_compare_integration(pytester: Pytester) -> None:
1287 pytester.makepyfile(
1288 """
1289 def test_hello():
1290 x = set(range(100))
1291 y = x.copy()
1292 y.remove(50)
1293 assert x == y
1294 """
1295 )
1296 result = pytester.runpytest()
1297 result.stdout.fnmatch_lines(
1298 [
1299 "*def test_hello():*",
1300 "*assert x == y*",
1301 "*E*Extra items*left*",
1302 "*E*50*",
1303 "*= 1 failed in*",
1304 ]
1305 )
1306
1307
1308def test_sequence_comparison_uses_repr(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected