Skip to content

Commit 293c4c9

Browse files
committed
get rid of dedicated doctest run
1 parent 4374fa7 commit 293c4c9

File tree

4 files changed

+23
-20
lines changed

4 files changed

+23
-20
lines changed

pyproject.toml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ lint = [
5454
test = [
5555
'pytest',
5656
'pytest-cov',
57+
'pytest-pythonhashseed',
5758
'pytest-ruff',
5859
'ruff==0.4.10',
5960
]
@@ -67,17 +68,21 @@ Homepage = 'https://github.com/mr-mixas/Nested-Diff.py'
6768
Repository = 'https://github.com/mr-mixas/Nested-Diff.py.git'
6869

6970
[tool.pytest.ini_options]
70-
addopts = """
71-
--cov=nested_diff \
72-
--cov-fail-under=99 \
73-
--cov-report term-missing \
74-
--no-cov-on-fail \
75-
--ruff \
76-
--ruff-format \
77-
--verbosity=2 \
78-
"""
71+
addopts = [
72+
'--cov=nested_diff',
73+
'--cov-fail-under=99',
74+
'--cov-report', 'term-missing',
75+
'--no-cov-on-fail',
76+
'--doctest-modules',
77+
'--doctest-glob=*.md',
78+
'--pythonhashseed', '1',
79+
'--ruff',
80+
'--ruff-format',
81+
'--verbosity=2',
82+
]
83+
7984
doctest_optionflags = 'NORMALIZE_WHITESPACE'
80-
testpaths = 'nested_diff tests'
85+
testpaths = 'nested_diff tests *.md'
8186

8287
[tool.ruff]
8388
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])

tests/test_misc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import os
2+
3+
4+
def test_pythonhashseed():
5+
assert os.environ['PYTHONHASHSEED'] == '1'

tox.ini

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

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

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

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

0 commit comments

Comments
 (0)