Make sure the tests do not match on magic values, no double underscored values, like '__dict__' and '+'.
(self, pytester: Pytester, keyword: str)
| 874 | ["__", "+", ".."], |
| 875 | ) |
| 876 | def test_no_magic_values(self, pytester: Pytester, keyword: str) -> None: |
| 877 | """Make sure the tests do not match on magic values, |
| 878 | no double underscored values, like '__dict__' and '+'. |
| 879 | """ |
| 880 | p = pytester.makepyfile( |
| 881 | """ |
| 882 | def test_one(): assert 1 |
| 883 | """ |
| 884 | ) |
| 885 | |
| 886 | reprec = pytester.inline_run("-k", keyword, p) |
| 887 | passed, skipped, failed = reprec.countoutcomes() |
| 888 | dlist = reprec.getcalls("pytest_deselected") |
| 889 | assert passed + skipped + failed == 0 |
| 890 | deselected_tests = dlist[0].items |
| 891 | assert len(deselected_tests) == 1 |
| 892 | |
| 893 | def test_no_match_directories_outside_the_suite(self, pytester: Pytester) -> None: |
| 894 | """`-k` should not match against directories containing the test suite (#7040).""" |
nothing calls this directly
no test coverage detected