Fix tests

This commit is contained in:
Filip Š
2020-03-28 16:25:57 +01:00
parent bbb77aa488
commit ed50cfd20a
2 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -18,7 +18,7 @@ class ArgsInterceptor:
self.kwargs = kwargs
MOCK_PROJECT_DIR = 'some_project_dir'
MOCK_PACKAGE_DIR = 'some_package_dir'
@pytest.fixture(autouse=True)
@@ -39,20 +39,20 @@ def mock_protection(monkeypatch):
@pytest.fixture(autouse=True)
def fake_project_dir(monkeypatch):
def fake_package_dir(monkeypatch):
'''
Monkey-patch enough for the main() function to run
'''
real_os_path_exists = os.path.exists
def mock_os_path_exists(path):
if path == os.path.join(MOCK_PROJECT_DIR, 'setup.py'):
if path == os.path.join(MOCK_PACKAGE_DIR, 'setup.py'):
return True
else:
return real_os_path_exists(path)
monkeypatch.setattr(os.path, 'exists', mock_os_path_exists)
monkeypatch.setattr(sys, 'argv', ['cibuildwheel', MOCK_PROJECT_DIR])
monkeypatch.setattr(sys, 'argv', ['cibuildwheel', MOCK_PACKAGE_DIR])
@pytest.fixture(params=['linux', 'macos', 'windows'])