Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Leap:15.6:Update
python-pytest-virtualenv
remove_mock.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File remove_mock.patch of Package python-pytest-virtualenv
--- a/tests/unit/test_venv.py +++ b/tests/unit/test_venv.py @@ -1,4 +1,7 @@ -import mock +try: + from unittest.mock import patch +except ImportError: + from mock import patch import pytest_virtualenv as venv from pytest_shutil import env @@ -6,7 +9,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 +21,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']
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor