2024-09-10 01:57:02 +02:00
|
|
|
"""Integrate `xdoctest` into the test suite.
|
|
|
|
|
|
|
|
Ensure all code snippets in docstrings are valid and functioning code.
|
|
|
|
|
|
|
|
Important: All modules with docstrings containing code snippets
|
|
|
|
must be put on the parameter list below by hand!
|
|
|
|
"""
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
import xdoctest
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
"module",
|
|
|
|
[
|
|
|
|
"lalib",
|
2024-09-18 18:29:40 +02:00
|
|
|
"lalib.elements",
|
2024-09-19 12:14:20 +02:00
|
|
|
"lalib.elements.galois",
|
2024-09-10 01:57:02 +02:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_docstrings(module):
|
|
|
|
"""Test code snippets within the package with `xdoctest`."""
|
|
|
|
result = xdoctest.doctest_module(module, "all")
|
|
|
|
|
|
|
|
assert result["n_failed"] == 0
|