We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f236624 commit b155722Copy full SHA for b155722
tests/test_documentation_build.py
@@ -1,18 +1,22 @@
1
"""Tests for documentation build."""
2
3
import os
4
-import sys
5
6
import pytest
7
8
try:
9
- import mkdocs # noqa: F401
10
-except ImportError:
11
- ...
+ import mkdocs
+ # Even if 'mkdocs' is installed
+ # 'mkdocs' is could be imported as <module 'mkdocs' (namespace)>
+ # Need to check if 'mkdocs' has '__version__' attribute
12
+
13
+ mkdocs_installed = hasattr(mkdocs, "__version__")
14
+except (ImportError, AttributeError):
15
+ mkdocs_installed = False
16
17
18
@pytest.mark.skipif(
- "mkdocs" not in sys.modules,
19
+ not mkdocs_installed,
20
reason=(
21
"Requires the MkDocs library. "
22
"And only test documentation in documentation building CI."
0 commit comments