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

Function test_skip_duplicates_by_default

testing/python/collect.py:1363–1380  ·  view source on GitHub ↗

Test for issue https://github.com/pytest-dev/pytest/issues/1609 (#1609) Ignore duplicate directories.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

1361
1362
1363def test_skip_duplicates_by_default(pytester: Pytester) -> None:
1364 """Test for issue https://github.com/pytest-dev/pytest/issues/1609 (#1609)
1365
1366 Ignore duplicate directories.
1367 """
1368 a = pytester.mkdir("a")
1369 fh = a.joinpath("test_a.py")
1370 fh.write_text(
1371 textwrap.dedent(
1372 """\
1373 import pytest
1374 def test_real():
1375 pass
1376 """
1377 )
1378 )
1379 result = pytester.runpytest(str(a), str(a))
1380 result.stdout.fnmatch_lines(["*collected 1 item*"])
1381
1382
1383def test_keep_duplicates(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
mkdirMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected