MCPcopy
hub / github.com/pytest-dev/pytest / test_collect_two_commandline_args

Method test_collect_two_commandline_args

testing/test_collection.py:618–641  ·  testing/test_collection.py::TestSession.test_collect_two_commandline_args
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

616 )
617
618 def test_collect_two_commandline_args(self, pytester: Pytester) -> None:
619 p = pytester.makepyfile(class="st">"def test_func(): pass")
620 aaa = pytester.mkpydir(class="st">"aaa")
621 bbb = pytester.mkpydir(class="st">"bbb")
622 test_aaa = aaa.joinpath(class="st">"test_aaa.py")
623 shutil.copy(p, test_aaa)
624 test_bbb = bbb.joinpath(class="st">"test_bbb.py")
625 p.replace(test_bbb)
626
627 id = class="st">"."
628
629 items, hookrec = pytester.inline_genitems(id)
630 assert len(items) == 2
631 pprint.pprint(hookrec.calls)
632 hookrec.assert_contains(
633 [
634 (class="st">"pytest_collectstart", class="st">"collector.path == test_aaa"),
635 (class="st">"pytest_pycollect_makeitem", class="st">"name == &class="cm">#x27;test_func'"),
636 (class="st">"pytest_collectreport", class="st">"report.nodeid == &class="cm">#x27;aaa/test_aaa.py'"),
637 (class="st">"pytest_collectstart", class="st">"collector.path == test_bbb"),
638 (class="st">"pytest_pycollect_makeitem", class="st">"name == &class="cm">#x27;test_func'"),
639 (class="st">"pytest_collectreport", class="st">"report.nodeid == &class="cm">#x27;bbb/test_bbb.py'"),
640 ]
641 )
642
643 def test_serialization_byid(self, pytester: Pytester) -> None:
644 pytester.makepyfile(class="st">"def test_func(): pass")

Callers

nothing calls this directly

Calls 5

copyMethod · 0.80
assert_containsMethod · 0.80
makepyfileMethod · 0.45
mkpydirMethod · 0.45
inline_genitemsMethod · 0.45

Tested by

no test coverage detected