Skip to content

Test docstring examples as part of CI runs

Vicentini Filippo requested to merge docstring-tests into master

Created by: femtobit

This PR adds a step to out GitHub Actions CI runs which executes all example sections in our docstring comments in order to make sure they are up-to-date and working as expected (f221a304).

Unsurprisingly, this has unearthed a lot of failing examples (mostly because of using old API or incomplete imports) which are fixed here as well (10b1baab).

Note that if a docstring example really should not be tested, it can be skipped by adding

>>> import pytest; pytest.skip("reason")

as I've done here (only) for some NETKET_EXPERIMENTAL code.

Merge request reports