From 8aaf9920c37a4d3b26d07d783960348a6eed29b8 Mon Sep 17 00:00:00 2001 From: muxator Date: Fri, 13 Sep 2024 10:11:33 +0200 Subject: [PATCH] tests: centralize --doctest-modules option in pytest.ini 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). --- Makefile | 2 +- pytest.ini | 2 ++ tox.ini | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c7006698..7aeb59fe 100644 --- a/Makefile +++ b/Makefile @@ -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 \ diff --git a/pytest.ini b/pytest.ini index be5c67a1..6fe47718 100644 --- a/pytest.ini +++ b/pytest.ini @@ -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 diff --git a/tox.ini b/tox.ini index 0a982d4f..d09864d2 100644 --- a/tox.ini +++ b/tox.ini @@ -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 \