Directly test the virtual env detection function
(self, pytester: Pytester, fname: str)
| 211 | ), |
| 212 | ) |
| 213 | def test__in_venv(self, pytester: Pytester, fname: str) -> None: |
| 214 | """Directly test the virtual env detection function""" |
| 215 | bindir = "Scripts" if sys.platform.startswith("win") else "bin" |
| 216 | # no bin/activate, not a virtualenv |
| 217 | base_path = pytester.mkdir("venv") |
| 218 | assert _in_venv(base_path) is False |
| 219 | # with bin/activate, totally a virtualenv |
| 220 | bin_path = base_path.joinpath(bindir) |
| 221 | bin_path.mkdir() |
| 222 | bin_path.joinpath(fname).touch() |
| 223 | assert _in_venv(base_path) is True |
| 224 | |
| 225 | def test_custom_norecursedirs(self, pytester: Pytester) -> None: |
| 226 | pytester.makeini( |