Skip to content

Commit ebd0cf0

Browse files
committed
Remove custom cadet_root from tests.
Add `local` tag to tests that require multiple different CADET installations which is not feasible on the CI and remove those tests from the CI.
1 parent 9d8411f commit ebd0cf0

5 files changed

+19
-7
lines changed

.github/workflows/pipeline.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ jobs:
6363
run: |
6464
pip install .[testing]
6565
mamba install cadet -c conda-forge
66-
pytest tests --rootdir=tests -m "not slow"
66+
pytest tests --rootdir=tests -m "not slow and not local"

pyproject.toml

+4
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,7 @@ line-length = 88
5151

5252
[tool.pytest.ini_options]
5353
testpaths = ["tests"]
54+
markers = [
55+
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
56+
"local: marks tests as only useful on local installs (deselect with '-m \"not local\"')",
57+
]

tests/test_dll.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
# %% Utility methods
99

10-
# TODO: Remove once #14 is merged
11-
# cadet_root = Path('/home/jo/code/CADET/install/capi/')
12-
cadet_root = Path(r'C:\Users\ronal\Documents\CADET\out\install\aRELEASE')
10+
# Use this to specify custom cadet_roots if you require it.
11+
cadet_root = None
1312

1413
def setup_model(
1514
cadet_root,

tests/test_install_path_settings.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
from cadet import Cadet
88

9+
""" These tests require two distinct CADET installations to compare between and should not run in the CI"""
10+
11+
912
# Full path to cadet.dll or cadet.so, that is different from the system/conda cadet
10-
full_path_dll = Path(r"C:\Users\ronal\Documents\CADET\out\install\aRELEASE\bin\cadet.dll")
13+
full_path_dll = Path("path/to/cadet")
1114

1215
install_path_conda = Cadet.autodetect_cadet()
1316

@@ -19,7 +22,7 @@ def test_autodetection():
1922
assert sim.cadet_cli_path.parent.parent == install_path_conda
2023
assert sim.cadet_runner.cadet_path.suffix not in [".dll", ".so"]
2124

22-
25+
@pytest.mark.local
2326
def test_install_path():
2427
sim = Cadet(install_path=full_path_dll, use_dll=True)
2528
assert sim.cadet_dll_path == full_path_dll
@@ -40,6 +43,7 @@ def test_install_path():
4043
assert sim.cadet_runner.cadet_path.suffix in [".dll", ".so"]
4144

4245

46+
@pytest.mark.local
4347
def test_dll_runner_attrs():
4448
cadet = Cadet(full_path_dll.parent.parent)
4549
cadet_runner = cadet._cadet_dll_runner
@@ -50,6 +54,7 @@ def test_dll_runner_attrs():
5054
assert isinstance(cadet_runner.cadet_path, str | os.PathLike)
5155

5256

57+
@pytest.mark.local
5358
def test_cli_runner_attrs():
5459
cadet = Cadet(full_path_dll.parent.parent)
5560
cadet_runner = cadet._cadet_cli_runner

tests/test_meta_class_install_path.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
from pathlib import Path
2+
import pytest
23

34
from cadet import Cadet
45

56

7+
""" These tests require two distinct CADET installations to compare between and should not run in the CI"""
8+
69
# Full path to cadet.dll or cadet.so, that is different from the system/conda cadet
7-
full_path_dll = Path(r"C:\Users\ronal\Documents\CADET\out\install\aRELEASE\bin\cadet.dll")
10+
full_path_dll = Path("path/to/cadet")
811

912
install_path_conda = Cadet.autodetect_cadet()
1013

1114

15+
@pytest.mark.local
1216
def test_meta_class():
1317
Cadet.cadet_path = full_path_dll
1418
assert Cadet.use_dll

0 commit comments

Comments
 (0)