Skip to content

Commit

Permalink
test: run doctest on rst files in docs/ (#1875)
Browse files Browse the repository at this point in the history
Currently there are only two files with doctests inside, but it is best
that we always run doctests just to ensure things are sane.

Other changes:

- added `doctest: +SKIP` to make doctests inside `docs/rdf_terms.rst`
  pass.

Fixes #1791
  • Loading branch information
aucampia authored May 4, 2022
1 parent 7ef3acf commit 8c0e74e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/rdf_terms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Here is the *URIRef* class' auto-built documentation:
.. code-block:: python
>>> from rdflib import URIRef
>>> uri = URIRef()
>>> uri = URIRef() # doctest: +SKIP
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __new__() missing 1 required positional argument: 'value'
Expand Down Expand Up @@ -137,9 +137,9 @@ Here is the *BNode* class' auto-built documentation:
>>> from rdflib import BNode
>>> bn = BNode()
>>> bn
>>> bn # doctest: +SKIP
rdflib.term.BNode('AFwALAKU0')
>>> bn.n3()
>>> bn.n3() # doctest: +SKIP
'_:AFwALAKU0'
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ addopts = [
"--ignore=admin",
"--ignore=rdflib/extras/external_graph_libs.py",
"--ignore-glob=docs/*.py",
"--doctest-glob=docs/*.rst",
]
doctest_optionflags = "ALLOW_UNICODE"
filterwarnings = [
Expand Down

0 comments on commit 8c0e74e

Please sign in to comment.