Add unit test for the option parsing

This commit is contained in:
Joe Rickerby
2020-12-21 11:00:33 +00:00
parent 0c9af0357b
commit f73b6083d5
2 changed files with 39 additions and 1 deletions
+10 -1
View File
@@ -70,5 +70,14 @@ def platform(request, monkeypatch):
@pytest.fixture
def intercepted_build_args(platform, monkeypatch):
intercepted = ArgsInterceptor()
monkeypatch.setattr(globals()[platform], 'build', intercepted)
if platform == 'linux':
monkeypatch.setattr(linux, 'build', intercepted)
elif platform == 'macos':
monkeypatch.setattr(macos, 'build', intercepted)
elif platform == 'windows':
monkeypatch.setattr(windows, 'build', intercepted)
else:
raise ValueError(f'unknown platform value: {platform}')
return intercepted