Mock Path.mkdir calls in unit tests

This commit is contained in:
Yannick Jadoul
2020-06-18 00:23:25 +02:00
parent b62b17a223
commit f012fa1af0
+5
View File
@@ -31,12 +31,17 @@ def mock_protection(monkeypatch):
def fail_on_call(*args, **kwargs):
raise RuntimeError("This should never be called")
def ignore_call(*args, **kwargs):
pass
monkeypatch.setattr(subprocess, 'Popen', fail_on_call)
monkeypatch.setattr(util, 'download', fail_on_call)
monkeypatch.setattr(windows, 'build', fail_on_call)
monkeypatch.setattr(linux, 'build', fail_on_call)
monkeypatch.setattr(macos, 'build', fail_on_call)
monkeypatch.setattr(Path, 'mkdir', ignore_call)
@pytest.fixture(autouse=True)
def fake_package_dir(monkeypatch):