(self, pytester: Pytester)
| 830 | |
| 831 | class 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", |
nothing calls this directly
no test coverage detected