Fix tests
This commit is contained in:
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user