Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def pytest_configure(config):
config.addinivalue_line(
"markers", "full_data: mark tests to run full pipelines on raw big data"
)
config.addinivalue_line(
"markers",
"full_data_parallel: mark tests to run full pipelines on raw big data in parallel",
)
config.addinivalue_line(
"markers", "preview: mark test to run with `httomo preview`"
)
Expand All @@ -54,6 +58,12 @@ def pytest_addoption(parser):
default=False,
help="run full pipelines on raw (big) data",
)
parser.addoption(
"--full_data_parallel",
action="store_true",
default=False,
help="run full pipelines on raw (big) data in parallel on two processes",
)


def pytest_collection_modifyitems(config, items):
Expand Down Expand Up @@ -93,6 +103,20 @@ def pytest_collection_modifyitems(config, items):
for item in items:
if "full_data" in item.keywords:
item.add_marker(skip_perf)
if config.getoption("--full_data_parallel"):
skip_other = pytest.mark.skip(
reason="not a pipeline raw big data test in parallel"
)
for item in items:
if "full_data_parallel" not in item.keywords:
item.add_marker(skip_other)
else:
skip_perf = pytest.mark.skip(
reason="pipeline raw big data test in parallel - use '--full_data_parallel' to run"
)
for item in items:
if "full_data_parallel" in item.keywords:
item.add_marker(skip_perf)


@pytest.fixture
Expand All @@ -113,6 +137,19 @@ def cmd():
]


@pytest.fixture
def cmd_mpirun():
return [
"mpirun",
"-n",
"2",
str(sys.executable),
"-m",
"httomo",
"run",
]


@pytest.fixture
def standard_data():
return "tests/test_data/tomo_standard.nxs"
Expand Down
Loading
Loading