-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
9 additions
and
4 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 |
---|---|---|
@@ -1,19 +1,23 @@ | ||
import pytest | ||
from pathlib import Path | ||
|
||
def pytest_collection_modifyitems(config, items): | ||
|
||
def pytest_collection_modifyitems(config, items): | ||
if not config.getoption("--integration"): | ||
skip_integration = pytest.mark.skip(reason="Integration test - use --integration to run") | ||
skip_integration = pytest.mark.skip( | ||
reason="Integration test - use --integration to run" | ||
) | ||
for item in items: | ||
test_path = Path(item.fspath) | ||
if "integration" in test_path.parts: | ||
item.add_marker(skip_integration) | ||
|
||
|
||
def pytest_addoption(parser): | ||
print("Adding custom option") # Debug print | ||
parser.addoption( | ||
"--integration", | ||
action="store_true", | ||
default=False, | ||
help="run integration tests" | ||
) | ||
help="run integration tests", | ||
) |
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