Matej Cepl
1b1a2d9997
- Add remove_mock.patch to remove dependency on the external mock package (gh#man-group/pytest-plugins#168). Also add remove_virtualenv.patch to remove dependency on external virtualenv package. OBS-URL: https://build.opensuse.org/request/show/855340 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-virtualenv?expand=0&rev=7
27 lines
987 B
Diff
27 lines
987 B
Diff
--- a/tests/unit/test_venv.py
|
|
+++ b/tests/unit/test_venv.py
|
|
@@ -1,4 +1,4 @@
|
|
-import mock
|
|
+from unittest.mock import patch
|
|
|
|
import pytest_virtualenv as venv
|
|
from pytest_shutil import env
|
|
@@ -6,7 +6,7 @@ from pytest_shutil import env
|
|
|
|
def test_PYTHONPATH_not_present_in_testing_env_if_set():
|
|
with env.set_env('PYTHONPATH', 'fred'):
|
|
- with mock.patch.object(venv.Workspace, 'run') as run:
|
|
+ with patch.object(venv.Workspace, 'run') as run:
|
|
venv.VirtualEnv()
|
|
call = run.mock_calls[0]
|
|
assert 'PYTHONPATH' not in call[2]['env']
|
|
@@ -18,7 +18,7 @@ def test_PYTHONPATH_not_present_in_testi
|
|
|
|
def test_PYTHONPATH_not_present_in_testing_env_if_unset():
|
|
with env.no_env('PYTHONPATH'):
|
|
- with mock.patch.object(venv.Workspace, 'run') as run:
|
|
+ with patch.object(venv.Workspace, 'run') as run:
|
|
venv.VirtualEnv()
|
|
call = run.mock_calls[0]
|
|
assert 'PYTHONPATH' not in call[2]['env']
|