MCPcopy
hub / github.com/pytest-dev/pytest / test__in_venv

Method test__in_venv

testing/test_collection.py:197–204  ·  view source on GitHub ↗

Directly test the virtual env detection function

(self, pytester: Pytester, env_path: PurePath)

Source from the content-addressed store, hash-verified

195
196 @known_environment_types
197 def test__in_venv(self, pytester: Pytester, env_path: PurePath) -> None:
198 """Directly test the virtual env detection function"""
199 # no env path, not a env
200 base_path = pytester.mkdir("venv")
201 assert _in_venv(base_path) is False
202 # with env path, totally a env
203 ensure_file(base_path.joinpath(env_path))
204 assert _in_venv(base_path) is True
205
206 def test_custom_norecursedirs(self, pytester: Pytester) -> None:
207 pytester.makeini(

Callers

nothing calls this directly

Calls 3

_in_venvFunction · 0.90
ensure_fileFunction · 0.85
mkdirMethod · 0.45

Tested by

no test coverage detected