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

Method test_select_simple

testing/test_mark.py:763–783  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

761
762class TestKeywordSelection:
763 def test_select_simple(self, pytester: Pytester) -> None:
764 file_test = pytester.makepyfile(
765 """
766 def test_one():
767 assert 0
768 class TestClass(object):
769 def test_method_one(self):
770 assert 42 == 43
771 """
772 )
773
774 def check(keyword, name):
775 reprec = pytester.inline_run("-s", "-k", keyword, file_test)
776 passed, skipped, failed = reprec.listoutcomes()
777 assert len(failed) == 1
778 assert failed[0].nodeid.split("::")[-1] == name
779 assert len(reprec.getcalls("pytest_deselected")) == 1
780
781 for keyword in ["test_one", "est_on"]:
782 check(keyword, "test_one")
783 check("TestClass and test", "test_method_one")
784
785 @pytest.mark.parametrize(
786 "keyword",

Callers

nothing calls this directly

Calls 2

checkFunction · 0.70
makepyfileMethod · 0.45

Tested by

no test coverage detected