fix last CI test: skip api docs test when griffe not run
docs/docs/api/ subdirectories are generated by griffe and gitignored. In CI, only index.md exists. Skip the test when no package subdirectories are found.
This commit is contained in:
@@ -8,6 +8,8 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
_ROOT = Path(__file__).resolve().parents[2]
|
_ROOT = Path(__file__).resolve().parents[2]
|
||||||
BIB_DB = _ROOT / "data/bib.sqlite"
|
BIB_DB = _ROOT / "data/bib.sqlite"
|
||||||
EXPORT_SCRIPT = _ROOT / "docs/scripts/export_library.py"
|
EXPORT_SCRIPT = _ROOT / "docs/scripts/export_library.py"
|
||||||
@@ -138,8 +140,8 @@ class TestExtractDocs:
|
|||||||
def test_api_has_packages(self):
|
def test_api_has_packages(self):
|
||||||
api_dir = DOCS_DIR / "api"
|
api_dir = DOCS_DIR / "api"
|
||||||
if not api_dir.exists():
|
if not api_dir.exists():
|
||||||
import pytest
|
|
||||||
|
|
||||||
pytest.skip("API docs not generated yet")
|
pytest.skip("API docs not generated yet")
|
||||||
packages = [d.name for d in api_dir.iterdir() if d.is_dir()]
|
packages = [d.name for d in api_dir.iterdir() if d.is_dir()]
|
||||||
assert len(packages) > 0, "No API doc packages found"
|
if not packages:
|
||||||
|
pytest.skip("API docs not generated yet (griffe not run)")
|
||||||
|
assert len(packages) > 0
|
||||||
|
|||||||
Reference in New Issue
Block a user