Skip to content

Commit

Permalink
Extra score modifier tests (#596)
Browse files Browse the repository at this point in the history
Add extra tests for the scoreModifier feature
  • Loading branch information
wanliAlex authored Sep 11, 2023
1 parent c0acb79 commit 859f195
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 134 deletions.
13 changes: 8 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@

def pytest_addoption(parser):
parser.addoption("--largemodel", action="store_true", default = False)
parser.addoption("--slow", action="store_true", default = False)


def pytest_configure(config):
config.addinivalue_line("markers", "largemodel: mark test as largemodels")
config.addinivalue_line("markers", "slow: mark test as slow")


def pytest_collection_modifyitems(config, items):
if config.getoption("--largemodel"):
# --largemodel given in cli: do not skip largemodel tests
return
skip_largemodel = pytest.mark.skip(reason="need --largemodel option to run")
skip_slow = pytest.mark.skip(reason="need --slow option to run")

for item in items:
if "largemodel" in item.keywords:
item.add_marker(skip_largemodel)
if "largemodel" in item.keywords and not config.getoption("--largemodel"):
item.add_marker(skip_largemodel)
if "slow" in item.keywords and not config.getoption("--slow"):
item.add_marker(skip_slow)
Loading

0 comments on commit 859f195

Please sign in to comment.