Skip to content

Commit 4d26689

Browse files
committed
simplify a bit
1 parent 3cc6c78 commit 4d26689

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

.github/workflows/docs-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
path: site/
3737

3838
- name: Test built result
39-
run: pytest .\tests\test_documentation_build.py
39+
run: pytest -m "documentation"
4040

4141
- name: Deploy docs preview to Netlify
4242
uses: nwtgck/[email protected]

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ markers =
1212
spark_functions: tests for pyspark functions
1313
xarray: tests for xarray functions
1414
timeseries: tests for timeseries
15+
documentation: tests for documentation
1516
turtle: tests that take more than 5 seconds to execute

tests/test_documentation_build.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22

33
import pytest
44

5-
try:
6-
import mkdocs
75

8-
# Even if 'mkdocs' is installed
9-
# 'mkdocs' is could be imported as <module 'mkdocs' (namespace)>
10-
# Need to check if 'mkdocs' has '__version__' attribute
11-
12-
mkdocs_installed = hasattr(mkdocs, "__version__")
13-
except (ImportError, AttributeError):
14-
mkdocs_installed = False
6+
# Even if 'mkdocs' is installed
7+
# 'mkdocs' is could be imported as <module 'mkdocs' (namespace)>
8+
# Need to check if 'mkdocs' has '__version__' attribute
9+
mkdocs = pytest.importorskip("mkdocs")
10+
mkdocs_installed = hasattr(mkdocs, "__version__")
1511

1612

1713
@pytest.mark.skipif(
@@ -21,6 +17,7 @@
2117
"And only test documentation in documentation building CI."
2218
),
2319
)
20+
@pytest.mark.documentation
2421
def test_docs_general_functions_present():
2522
"""Test that all docs pages build correctly.
2623

0 commit comments

Comments
 (0)