Skip to content

Commit f9a7186

Browse files
committed
tests: remove superfluous unit tests
`sysconfig.get_path` can't be `None`, the stubs were wrong.
1 parent 08c88b2 commit f9a7186

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

tests/test_env.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -51,34 +51,6 @@ def test_isolated_environment_install(mocker):
5151
]
5252

5353

54-
@pytest.mark.skipif(IS_PY2, reason='venv module used on Python 3 only')
55-
@pytest.mark.skipif(IS_PYPY3, reason='PyPy3 uses get path to create and provision venv')
56-
def test_fail_to_get_script_path(mocker):
57-
mocker.patch.object(build.env, 'virtualenv', None)
58-
get_path = mocker.patch('sysconfig.get_path', return_value=None)
59-
with pytest.raises(RuntimeError, match="Couldn't get environment scripts path"):
60-
env = build.env.IsolatedEnvBuilder()
61-
with env:
62-
pass
63-
assert not os.path.exists(env._path)
64-
assert get_path.call_count == 1
65-
66-
67-
@pytest.mark.skipif(IS_PY2, reason='venv module used on Python 3 only')
68-
@pytest.mark.skipif(IS_PYPY3, reason='PyPy3 uses get path to create and provision venv')
69-
def test_fail_to_get_purepath(mocker):
70-
mocker.patch.object(build.env, 'virtualenv', None)
71-
sysconfig_get_path = sysconfig.get_path
72-
mocker.patch(
73-
'sysconfig.get_path',
74-
side_effect=lambda path, *args, **kwargs: '' if path == 'purelib' else sysconfig_get_path(path, *args, **kwargs),
75-
)
76-
77-
with pytest.raises(RuntimeError, match="Couldn't get environment purelib folder"):
78-
with build.env.IsolatedEnvBuilder():
79-
pass
80-
81-
8254
@pytest.mark.skipif(IS_PY2, reason='venv module used on Python 3 only')
8355
@pytest.mark.skipif(IS_PYPY3, reason='PyPy3 uses get path to create and provision venv')
8456
def test_executable_missing_post_creation(mocker):

0 commit comments

Comments
 (0)