Mock Path.mkdir calls in unit tests
This commit is contained in:
@@ -31,12 +31,17 @@ def mock_protection(monkeypatch):
|
|||||||
def fail_on_call(*args, **kwargs):
|
def fail_on_call(*args, **kwargs):
|
||||||
raise RuntimeError("This should never be called")
|
raise RuntimeError("This should never be called")
|
||||||
|
|
||||||
|
def ignore_call(*args, **kwargs):
|
||||||
|
pass
|
||||||
|
|
||||||
monkeypatch.setattr(subprocess, 'Popen', fail_on_call)
|
monkeypatch.setattr(subprocess, 'Popen', fail_on_call)
|
||||||
monkeypatch.setattr(util, 'download', fail_on_call)
|
monkeypatch.setattr(util, 'download', fail_on_call)
|
||||||
monkeypatch.setattr(windows, 'build', fail_on_call)
|
monkeypatch.setattr(windows, 'build', fail_on_call)
|
||||||
monkeypatch.setattr(linux, 'build', fail_on_call)
|
monkeypatch.setattr(linux, 'build', fail_on_call)
|
||||||
monkeypatch.setattr(macos, 'build', fail_on_call)
|
monkeypatch.setattr(macos, 'build', fail_on_call)
|
||||||
|
|
||||||
|
monkeypatch.setattr(Path, 'mkdir', ignore_call)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def fake_package_dir(monkeypatch):
|
def fake_package_dir(monkeypatch):
|
||||||
|
|||||||
Reference in New Issue
Block a user