def test__in_venv(self, pytester: Pytester, env_path: PurePath) -> None:
        """Directly test the virtual env detection function"""
        # no env path, not a env
        base_path = pytester.mkdir("venv")
        assert _in_venv(base_path) is False
        # with env path, totally a env
        ensure_file(base_path.joinpath(env_path))
        assert _in_venv(base_path) is True
Directly test the virtual env detection function
testing/test_collection.py