Skip to content

Commit 2f96dd3

Browse files
committed
Migrate pytest markers and options from message_data
- ece_db and slow markers. - Skip tests marked ece_db by default.
1 parent 0e232c5 commit 2f96dd3

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

.github/workflows/pytest.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
- name: Run test suite using pytest
124124
run: |
125125
pytest message_ix_models \
126-
-m "not snapshot" \
126+
-m "not (ece_db or snapshot)" \
127127
-rA --verbose --color=yes --durations=20 \
128128
--cov-report=term-missing --cov-report=xml \
129129
--numprocesses=auto \

conftest.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# Modules containing fixtures to use in testing
2-
pytest_plugins = ["ixmp.testing", "message_ix_models.testing"]
2+
pytest_plugins = [
3+
"genno.testing",
4+
"ixmp.testing",
5+
"message_ix_models.testing",
6+
]

pyproject.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,18 @@ module = ["ixmp.*"]
130130
no_implicit_optional = false
131131

132132
[tool.pytest.ini_options]
133-
# Disable faulthandler plugin on Windows to prevent spurious console noise
134-
addopts = "-p no:faulthandler --cov=message_ix_models --cov-report="
133+
# Default options for invoking pytest
134+
# - Skip tests with the "ece_db" marker
135+
# - Disable faulthandler plugin on Windows to prevent spurious console noise
136+
# - No coverage report
137+
addopts = """
138+
-m "not ece_db"
139+
-p no:faulthandler
140+
--cov=message_ix_models --cov-report="""
135141
filterwarnings = "ignore:distutils Version classes.*:DeprecationWarning"
136142
markers = [
143+
"ece_db: Tests requiring access to IIASA ECE internal databases",
144+
"slow: Tests that typically take more than ~45 seconds wall time",
137145
"snapshot: Slow tests using the public MESSAGEix-GLOBIOM baseline snapshot",
138146
]
139147

0 commit comments

Comments
 (0)