Skip to content

Commit

Permalink
tests: centralize --doctest-modules option in pytest.ini
Browse files Browse the repository at this point in the history
We have meaningful doctests in the code base. Before this change, their
execution had to be manually activated in Makefile and tox.ini.

This change centralizes the option in pytest.ini, so that we reduce the future
occurrence of human errors (less duplication, less oversights).
  • Loading branch information
muxator authored and muxator committed Sep 13, 2024
1 parent 7f083a5 commit 01593e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ darglint-files: ## run darglint for specific files (specified with files="file1
test: ## run tests quickly with the default Python
pytest \
tests/ \
--doctest-modules black_it \
black_it \
--cov=black_it \
--cov-report=xml \
--cov-report=html \
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ log_cli_date_format=%Y-%m-%d %H:%M:%S

markers =
e2e: marks end-to-end tests which involve several library components.

addopts = --doctest-modules
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ deps =
mistletoe==1.2.1

commands =
pytest --basetemp={envtmpdir} --doctest-modules \
pytest --basetemp={envtmpdir} \
black_it tests/ \
--cov=black_it \
--ignore=example/models \
Expand Down

0 comments on commit 01593e7

Please sign in to comment.