Skip to content

Commit

Permalink
get rid of dedicated doctest run
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-mixas committed Jun 21, 2024
1 parent 261dc6e commit 07120db
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
25 changes: 15 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ lint = [
test = [
'pytest',
'pytest-cov',
'pytest-pythonhashseed',
'pytest-ruff',
'ruff==0.3.0', # pin for reproducible results
]
Expand All @@ -80,17 +81,21 @@ Homepage = 'https://github.com/mr-mixas/Nested-Diff.py'
Repository = 'https://github.com/mr-mixas/Nested-Diff.py.git'

[tool.pytest.ini_options]
addopts = """
--cov=nested_diff \
--cov-fail-under=99 \
--cov-report term-missing \
--no-cov-on-fail \
--ruff \
--ruff-format \
--verbosity=2 \
"""
addopts = [
'--cov=nested_diff',
'--cov-fail-under=99',
'--cov-report', 'term-missing',
'--no-cov-on-fail',
'--doctest-modules',
'--doctest-glob=*.md',
'--pythonhashseed=1',
'--ruff',
'--ruff-format',
'--verbosity=2',
]

doctest_optionflags = 'NORMALIZE_WHITESPACE'
testpaths = 'nested_diff tests'
testpaths = 'nested_diff tests *.md'

[tool.ruff]
extend-exclude = [
Expand Down
4 changes: 2 additions & 2 deletions tests/data/gen_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def format_test(**kwargs):
}},""".format(**kwargs)


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


if __name__ == '__main__':
generate_tests()
generate_tests(sys.argv[1])
9 changes: 1 addition & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,14 @@ extras =
cli
test

setenv =
PYTHONHASHSEED = 1

[testenv:extended]
commands =
pytest --doctest-modules --flake8
python -m doctest HOWTO.md README.md
pytest --flake8

extras =
{[testenv:essential]extras}
lint

setenv =
PYTHONHASHSEED = 1

# pyproject.toml not support yet
[darglint]
docstring_style=google
Expand Down

0 comments on commit 07120db

Please sign in to comment.