Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions dev_tools/tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ..docs import nxdl_indices
from ..globals.directories import get_xsd_file
from ..nxdl import iter_definitions
from .utils import pytest_path_param_id


@pytest.fixture(scope="module")
Expand All @@ -26,17 +27,23 @@ def anchor_registry_write(tmpdir_factory):
reg.write()


@pytest.mark.parametrize("nxdl_file", list(iter_definitions()))
@pytest.mark.parametrize(
"nxdl_file", list(iter_definitions()), ids=pytest_path_param_id
)
def test_nxdl_generate_doc(nxdl_file, doc_generator):
assert doc_generator(nxdl_file)


@pytest.mark.parametrize("nxdl_file", list(iter_definitions()))
@pytest.mark.parametrize(
"nxdl_file", list(iter_definitions()), ids=pytest_path_param_id
)
def test_nxdl_anchor_list(nxdl_file, doc_generator, anchor_registry):
assert doc_generator(nxdl_file, anchor_registry=anchor_registry)


@pytest.mark.parametrize("nxdl_file", list(iter_definitions()))
@pytest.mark.parametrize(
"nxdl_file", list(iter_definitions()), ids=pytest_path_param_id
)
def test_nxdl_anchor_write_list(nxdl_file, doc_generator, anchor_registry_write):
assert doc_generator(nxdl_file, anchor_registry=anchor_registry_write)

Expand Down
5 changes: 4 additions & 1 deletion dev_tools/tests/test_nxdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ..nxdl import iter_definitions
from ..nxdl import nxdl_schema
from ..nxdl import validate_definition
from .utils import pytest_path_param_id


def test_iter_definitions():
Expand All @@ -25,6 +26,8 @@ def xml_schema():
return nxdl_schema()


@pytest.mark.parametrize("nxdl_file", list(iter_definitions()))
@pytest.mark.parametrize(
"nxdl_file", list(iter_definitions()), ids=pytest_path_param_id
)
def test_nxdl_syntax(nxdl_file, xml_schema):
validate_definition(nxdl_file, xml_schema)
5 changes: 5 additions & 0 deletions dev_tools/tests/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from pathlib import Path


def pytest_path_param_id(path: Path) -> str:
return f"{path.parent.name}/{path.name}"
Loading