Skip to content

Commit

Permalink
fix: add skip marker to ignored tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Raine-Yang-UofT committed Dec 31, 2024
1 parent a226852 commit 6e0f566
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,8 @@ def pytest_collection_modifyitems(config, items):
if not config.getoption("--exclude-z3"):
return

selected = []
deselected = []

skip_marker = pytest.mark.skip(reason="Only run when z3-solver is installed")
for item in items:
# Check if the test's nodeid matches any Z3-related patterns
if any(re.search(pattern, item.nodeid) for pattern in Z3_RELATED_TESTS):
deselected.append(item)
else:
selected.append(item)

if deselected:
config.hook.pytest_deselected(items=deselected)
items[:] = selected
item.add_marker(skip_marker)

0 comments on commit 6e0f566

Please sign in to comment.