Add doctests to the test suite

- use xdoctest to validate code snippets in docstrings
- make xdoctest part of the nox session "test" via
  the new `test_docstrings()` test case
- add nox session "test-docstrings" for convenience;
  also, `xdoctest.doctest_module()` does not discover
  docstrings that are imported at the root of the package
  => each new module with docstrings must be added to
     `test_docstrings()` by hand, which is likely forgotten
  => the nox session "test-docstrings" should run on CI
This commit is contained in:
Alexander Hess 2024-09-10 01:57:02 +02:00
commit 01d270e39c
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
5 changed files with 76 additions and 2 deletions

View file

@ -1,4 +1,10 @@
"""A Python library to study linear algebra."""
"""A Python library to study linear algebra.
First, verify that your installation of `lalib` works:
>>> import lalib
>>> lalib.__version__ != '0.0.0'
True
"""
from importlib import metadata