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

Method test_select_simple

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

Source from the content-addressed store, hash-verified

830
831class TestKeywordSelection:
832 def test_select_simple(self, pytester: Pytester) -> None:
833 file_test = pytester.makepyfile(
834 """
835 def test_one():
836 assert 0
837 class TestClass(object):
838 def test_method_one(self):
839 assert 42 == 43
840 """
841 )
842
843 def check(keyword, name):
844 reprec = pytester.inline_run("-s", "-k", keyword, file_test)
845 _passed, _skipped, failed = reprec.listoutcomes()
846 assert len(failed) == 1
847 assert failed[0].nodeid.split("::")[-1] == name
848 assert len(reprec.getcalls("pytest_deselected")) == 1
849
850 for keyword in ["test_one", "est_on"]:
851 check(keyword, "test_one")
852 check("TestClass and test", "test_method_one")
853
854 @pytest.mark.parametrize(
855 "keyword",

Callers

nothing calls this directly

Calls 2

checkFunction · 0.70
makepyfileMethod · 0.45

Tested by

no test coverage detected