Skip to content

Commit

Permalink
Mock Path.mkdir calls in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickJadoul committed Jun 17, 2020
1 parent b62b17a commit f012fa1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions unit_test/main_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit f012fa1

Please sign in to comment.