(self, pytester: Pytester, env_path: PurePath)
| 165 | |
| 166 | @known_environment_types |
| 167 | def test_ignored_virtualenvs(self, pytester: Pytester, env_path: PurePath) -> None: |
| 168 | ensure_file(pytester.path / "virtual" / env_path) |
| 169 | testfile = ensure_file(pytester.path / "virtual" / "test_invenv.py") |
| 170 | testfile.write_text("def test_hello(): pass", encoding="utf-8") |
| 171 | |
| 172 | # by default, ignore tests inside a virtualenv |
| 173 | result = pytester.runpytest() |
| 174 | result.stdout.no_fnmatch_line("*test_invenv*") |
| 175 | # allow test collection if user insists |
| 176 | result = pytester.runpytest("--collect-in-virtualenv") |
| 177 | assert "test_invenv" in result.stdout.str() |
| 178 | # allow test collection if user directly passes in the directory |
| 179 | result = pytester.runpytest("virtual") |
| 180 | assert "test_invenv" in result.stdout.str() |
| 181 | |
| 182 | @known_environment_types |
| 183 | def test_ignored_virtualenvs_norecursedirs_precedence( |
nothing calls this directly
no test coverage detected