You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pytest was using config from `tox.ini` preferentially and ignoring config
from `setup.cfg`, as a side-effect doctests were not running on
code/docstrings in `rdflib/`.
The reason why some pytest config was in `tox.ini` instead of `setup.cfg`
was because of these issues:
- pypa/pip#5182
- pytest-dev/pytest#3062
As a compromise to fix this I have opted for moving all pytest config to
`pyproject.toml`:
- https://docs.pytest.org/en/stable/reference/customize.html#pyproject-toml
This seems sensible as `pyproject.toml` is standarized by PEPs and
eventually most things from `setup.cfg` will end up in there anyway.
Also:
- remove the pytest ignore on `test/translate_algebra` as tests in there
have been running and passing for some time.
- fixed path to test data in `rdflib/plugins/parsers/nquads.py`.
Copy file name to clipboardExpand all lines: pyproject.toml
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,22 @@ exclude = '''
28
28
)/
29
29
)
30
30
'''
31
+
32
+
[tool.pytest.ini_options]
33
+
addopts = [
34
+
"--doctest-modules",
35
+
"--ignore=admin",
36
+
"--ignore=rdflib/extras/external_graph_libs.py",
37
+
"--ignore-glob=docs/*.py",
38
+
]
39
+
doctest_optionflags = "ALLOW_UNICODE"
40
+
filterwarnings = [
41
+
# The below warning is a consequence of how pytest doctest detects mocks and how DefinedNamespace behaves when an undefined attribute is being accessed.
42
+
"ignore:Code. pytest_mock_example_attribute_that_shouldnt_exist is not defined in namespace .*:UserWarning",
43
+
# The below warning is a consequence of how pytest detects fixtures and how DefinedNamespace behaves when an undefined attribute is being accessed.
44
+
"ignore:Code. _pytestfixturefunction is not defined in namespace .*:UserWarning",
Copy file name to clipboardExpand all lines: setup.cfg
-14Lines changed: 0 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -70,17 +70,3 @@ skip =
70
70
build,
71
71
dist,
72
72
venv,
73
-
74
-
[tool:pytest]
75
-
addopts =
76
-
--doctest-modules
77
-
--ignore=test/translate_algebra
78
-
--ignore=admin
79
-
--ignore=rdflib/extras/external_graph_libs.py
80
-
--ignore-glob=docs/*.py
81
-
doctest_optionflags = ALLOW_UNICODE
82
-
filterwarnings =
83
-
# The below warning is a consequence of how pytest doctest detects mocks and how DefinedNamespace behaves when an undefined attribute is being accessed.
84
-
ignore:Code. pytest_mock_example_attribute_that_shouldnt_exist is not defined in namespace .*:UserWarning
85
-
# The below warning is a consequence of how pytest detects fixtures and how DefinedNamespace behaves when an undefined attribute is being accessed.
86
-
ignore:Code. _pytestfixturefunction is not defined in namespace .*:UserWarning
0 commit comments