forked from scverse/scanpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conftest.py
21 lines (18 loc) · 770 Bytes
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import pytest
# Command line options for pytest must be added from conftest.py from where
# `pytest` is called.
def pytest_addoption(parser):
parser.addoption(
"--internet-tests",
action="store_true",
default=False,
help="Run tests that retrieve stuff from the internet. This increases test time.",
)
def pytest_collection_modifyitems(config, items):
run_internet = config.getoption("--internet-tests")
skip_internet = pytest.mark.skip(reason="need --internet-tests option to run")
for item in items:
# All tests marked with `pytest.mark.internet` get skipped unless
# `--run-internet` passed
if not run_internet and ("internet" in item.keywords):
item.add_marker(skip_internet)