dev.tests
#
Helper functions for tests.
Submodules#
Package Contents#
Classes#
Functions#
Initialize test plot formats. |
|
Get cached notebook namespace. |
|
Parametrize this test by cases. |
|
Clean notebooks using pre-commit hooks. |
Data#
Random name sequence for case files. |
API#
- dev.tests.NAMER: collections.abc.Iterator[str]#
‘_RandomNameSequence(…)’
Random name sequence for case files.
- dev.tests.init()#
Initialize test plot formats.
- dev.tests.get_cached_nb_ns(
- nb: str,
- params: dev.tests.types.Params | None = None,
- attributes: dev.tests.types.Attributes | None = None,
Get cached notebook namespace.
- class dev.tests.Case#
Notebook test case.
Args: stage: Notebook stage. suffix: Test ID suffix. params: Parameters to pass to the notebook.
- marks: collections.abc.Sequence[pytest.Mark]#
‘field(…)’
Pytest marks.
- clean_path: pathlib.Path | None#
‘field(…)’
Path to the cleaned notebook.
- property path: pathlib.Path#
Notebook path.
- dev.tests.parametrize_by_cases(
- *cases: dev.tests.Case,
Parametrize this test by cases.
- class dev.tests.Caser#
Notebook test case generator.
- exp: pathlib.Path#
None
- cases: list[dev.tests.Case]#
‘field(…)’
- __call__(
- stage: str,
- id: str = '_',
- params: dict[str, Any] | None = None,
- results: list[str] | None = None,
- marks: collections.abc.Sequence[pytest.Mark] | None = None,
Add case to experiment.
- dev.tests.clean_notebooks(
- *nbs: pathlib.Path | str,
Clean notebooks using pre-commit hooks.