-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark tests as 'avoidable' to prevent them from running on Github
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
#################################|###|##################################### | ||
# __ | | # | ||
# | |--.--.--.----.-----.-----. |===| This file is part of Byron v0.8 # | ||
# | _ | | | _| _ | | |___| An evolutionary optimizer & fuzzer # | ||
# |_____|___ |__| |_____|__|__| ).( https://github.com/squillero/byron # | ||
# |_____| \|/ # | ||
################################## ' ###################################### | ||
# Copyright 2023 Giovanni Squillero and Alberto Tonda | ||
# SPDX-License-Identifier: Apache-2.0 | ||
import pytest | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption("--all", action="store_true", default=False, help="run all tests (including 'avoidable' ones)") | ||
|
||
|
||
def pytest_configure(config): | ||
config.addinivalue_line("markers", "avoidable: mark test as avoidable (require --all)") | ||
|
||
|
||
def pytest_collection_modifyitems(config, items): | ||
if config.getoption("--all"): | ||
return | ||
skip_avoidable = pytest.mark.skip(reason="need --all option to run") | ||
for item in items: | ||
if "avoidable" in item.keywords: | ||
item.add_marker(skip_avoidable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters