(self, pytester: Pytester, fname: str)
| 159 | ), |
| 160 | ) |
| 161 | def test_ignored_virtualenvs(self, pytester: Pytester, fname: str) -> None: |
| 162 | bindir = "Scripts" if sys.platform.startswith("win") else "bin" |
| 163 | ensure_file(pytester.path / "virtual" / bindir / fname) |
| 164 | testfile = ensure_file(pytester.path / "virtual" / "test_invenv.py") |
| 165 | testfile.write_text("def test_hello(): pass") |
| 166 | |
| 167 | # by default, ignore tests inside a virtualenv |
| 168 | result = pytester.runpytest() |
| 169 | result.stdout.no_fnmatch_line("*test_invenv*") |
| 170 | # allow test collection if user insists |
| 171 | result = pytester.runpytest("--collect-in-virtualenv") |
| 172 | assert "test_invenv" in result.stdout.str() |
| 173 | # allow test collection if user directly passes in the directory |
| 174 | result = pytester.runpytest("virtual") |
| 175 | assert "test_invenv" in result.stdout.str() |
| 176 | |
| 177 | @pytest.mark.parametrize( |
| 178 | "fname", |
nothing calls this directly
no test coverage detected