Skip to content

Commit 07120db

Browse files
committed
get rid of dedicated doctest run
1 parent 261dc6e commit 07120db

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

pyproject.toml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ lint = [
6767
test = [
6868
'pytest',
6969
'pytest-cov',
70+
'pytest-pythonhashseed',
7071
'pytest-ruff',
7172
'ruff==0.3.0', # pin for reproducible results
7273
]
@@ -80,17 +81,21 @@ Homepage = 'https://github.com/mr-mixas/Nested-Diff.py'
8081
Repository = 'https://github.com/mr-mixas/Nested-Diff.py.git'
8182

8283
[tool.pytest.ini_options]
83-
addopts = """
84-
--cov=nested_diff \
85-
--cov-fail-under=99 \
86-
--cov-report term-missing \
87-
--no-cov-on-fail \
88-
--ruff \
89-
--ruff-format \
90-
--verbosity=2 \
91-
"""
84+
addopts = [
85+
'--cov=nested_diff',
86+
'--cov-fail-under=99',
87+
'--cov-report', 'term-missing',
88+
'--no-cov-on-fail',
89+
'--doctest-modules',
90+
'--doctest-glob=*.md',
91+
'--pythonhashseed=1',
92+
'--ruff',
93+
'--ruff-format',
94+
'--verbosity=2',
95+
]
96+
9297
doctest_optionflags = 'NORMALIZE_WHITESPACE'
93-
testpaths = 'nested_diff tests'
98+
testpaths = 'nested_diff tests *.md'
9499

95100
[tool.ruff]
96101
extend-exclude = [

tests/data/gen_standard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def format_test(**kwargs):
1515
}},""".format(**kwargs)
1616

1717

18-
def generate_tests(source_dir=sys.argv[1]):
18+
def generate_tests(source_dir):
1919
tests = []
2020
for file_name in sorted(os.listdir(source_dir)):
2121
with open(os.path.join(source_dir, file_name)) as f:
@@ -66,4 +66,4 @@ def get_tests():
6666

6767

6868
if __name__ == '__main__':
69-
generate_tests()
69+
generate_tests(sys.argv[1])

tox.ini

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,14 @@ extras =
1010
cli
1111
test
1212

13-
setenv =
14-
PYTHONHASHSEED = 1
15-
1613
[testenv:extended]
1714
commands =
18-
pytest --doctest-modules --flake8
19-
python -m doctest HOWTO.md README.md
15+
pytest --flake8
2016

2117
extras =
2218
{[testenv:essential]extras}
2319
lint
2420

25-
setenv =
26-
PYTHONHASHSEED = 1
27-
2821
# pyproject.toml not support yet
2922
[darglint]
3023
docstring_style=google

0 commit comments

Comments
 (0)