Skip to content

Commit 8c0e74e

Browse files
authored
test: run doctest on rst files in docs/ (#1875)
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
1 parent 7ef3acf commit 8c0e74e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/rdf_terms.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Here is the *URIRef* class' auto-built documentation:
106106
.. code-block:: python
107107
108108
>>> from rdflib import URIRef
109-
>>> uri = URIRef()
109+
>>> uri = URIRef() # doctest: +SKIP
110110
Traceback (most recent call last):
111111
File "<stdin>", line 1, in <module>
112112
TypeError: __new__() missing 1 required positional argument: 'value'
@@ -137,9 +137,9 @@ Here is the *BNode* class' auto-built documentation:
137137
138138
>>> from rdflib import BNode
139139
>>> bn = BNode()
140-
>>> bn
140+
>>> bn # doctest: +SKIP
141141
rdflib.term.BNode('AFwALAKU0')
142-
>>> bn.n3()
142+
>>> bn.n3() # doctest: +SKIP
143143
'_:AFwALAKU0'
144144
145145

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ addopts = [
3535
"--ignore=admin",
3636
"--ignore=rdflib/extras/external_graph_libs.py",
3737
"--ignore-glob=docs/*.py",
38+
"--doctest-glob=docs/*.rst",
3839
]
3940
doctest_optionflags = "ALLOW_UNICODE"
4041
filterwarnings = [

0 commit comments

Comments
 (0)