Skip to content

Commit e79c840

Browse files
authored
Merge pull request RDFLib#1846 from aucampia/iwana-20220418T1104-clean_rdflib
text: fix pytest config Merging this with only one PR as this primarily just changes pytest config and consequently increases test coverage significantly.
2 parents 8a92d35 + be32bb6 commit e79c840

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,22 @@ exclude = '''
2828
)/
2929
)
3030
'''
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",
45+
]
46+
# log_cli = true
47+
# log_cli_level = "DEBUG"
48+
log_cli_format = "%(asctime)s %(levelname)-8s %(name)-12s %(filename)s:%(lineno)s:%(funcName)s %(message)s"
49+
log_cli_date_format = "%Y-%m-%dT%H:%M:%S"

rdflib/plugins/parsers/nquads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
>>> from rdflib import ConjunctiveGraph, URIRef, Namespace
77
>>> g = ConjunctiveGraph()
8-
>>> data = open("test/nquads.rdflib/example.nquads", "rb")
8+
>>> data = open("test/data/nquads.rdflib/example.nquads", "rb")
99
>>> g.parse(data, format="nquads") # doctest:+ELLIPSIS
1010
<Graph identifier=... (<class 'rdflib.graph.Graph'>)>
1111
>>> assert len(g.store) == 449

setup.cfg

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,3 @@ skip =
7070
build,
7171
dist,
7272
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

tox.ini

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,3 @@ passenv = HOMEPATH # needed on Windows
4343
commands =
4444
precommit: pre-commit run
4545
precommitall: pre-commit run --all-files
46-
47-
[pytest]
48-
# log_cli = true
49-
# log_cli_level = DEBUG
50-
log_cli_format = %(asctime)s %(levelname)-8s %(name)-12s %(filename)s:%(lineno)s:%(funcName)s %(message)s
51-
log_cli_date_format=%Y-%m-%dT%H:%M:%S

0 commit comments

Comments
 (0)