From 39d86f04300332504f32200291620afff7039378 Mon Sep 17 00:00:00 2001 From: Nils Homer Date: Wed, 24 Jul 2024 13:44:46 -0700 Subject: [PATCH] move to pytest-doctestplus --- ci/check.sh | 2 +- poetry.lock | 34 ++++++++++++++++++++-------------- pyproject.toml | 5 +++-- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/ci/check.sh b/ci/check.sh index 6cdf56fa..b4b58651 100755 --- a/ci/check.sh +++ b/ci/check.sh @@ -41,7 +41,7 @@ run "Style Checking" "ruff format fgpyo tests" run "Linting" "ruff check --fix fgpyo tests" run "Type Checking" "mypy fgpyo tests --config $parent/mypy.ini" run "Unit Tests" "python -m pytest -vv -r sx tests" -run "Doc Tests" "python -m pytest -vv -r sx fgpyo" +run "Doc Tests" "python -m pytest -vv -r sx fgpyo tests" run "Make docs" "mkdocs build --strict" if [ -z "$failures" ]; then diff --git a/poetry.lock b/poetry.lock index b7fe484a..2ac5fef4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -736,19 +736,6 @@ files = [ griffe = ">=0.47" mkdocstrings = ">=0.25" -[[package]] -name = "mktestdocs" -version = "0.2.2" -description = "" -optional = false -python-versions = "*" -files = [ - {file = "mktestdocs-0.2.2-py2.py3-none-any.whl", hash = "sha256:b0eea09c14cb9df7bf112f848c3d5069713519eddb3b0b2223211699246c3f1d"}, -] - -[package.extras] -test = ["pytest (>=4.0.2)"] - [[package]] name = "mypy" version = "1.10.1" @@ -1127,6 +1114,25 @@ pytest = ">=4.6" [package.extras] testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] +[[package]] +name = "pytest-doctestplus" +version = "1.2.1" +description = "Pytest plugin with advanced doctest features." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-doctestplus-1.2.1.tar.gz", hash = "sha256:2472a8a2c8cea34d2f65f6499543faeb748eecb59c597852fd98839b47307679"}, + {file = "pytest_doctestplus-1.2.1-py3-none-any.whl", hash = "sha256:103705daee8d4468eb59d444c29b0d71eb85b8f6d582295c8bc3d68ee1d88911"}, +] + +[package.dependencies] +packaging = ">=17.0" +pytest = ">=4.6" +setuptools = ">=30.3.0" + +[package.extras] +test = ["numpy", "pytest-remotedata (>=0.3.2)", "sphinx"] + [[package]] name = "python-dateutil" version = "2.9.0.post0" @@ -1549,4 +1555,4 @@ docs = ["black", "mkdocs", "mkdocs-autorefs", "mkdocs-gen-files", "mkdocs-includ [metadata] lock-version = "2.0" python-versions = ">=3.8.0,<4.0" -content-hash = "d15163bd56662b51613945340f558b97caddb877ed2523f30365f0f2955e6472" +content-hash = "cd2ddd60fe6cc48c5877841d3f4a989c32fc64df304d9a5926a9d2bf1589cd9e" diff --git a/pyproject.toml b/pyproject.toml index a2ff9462..394083e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ numpy = [ {version = "^1.24.4", python = "<3.9"} ] strenum = "^0.4.15" -mktestdocs = "^0.2.2" +pytest-doctestplus = "^1.2.1" [tool.poetry.extras] docs = [ @@ -87,5 +87,6 @@ unfixable = ["B"] force-single-line = true [tool.pytest.ini_options] -addopts = "--doctest-modules" +addopts = "--doctest-plus" +doctest_plus = "enabled" doctest_optionflags = "NORMALIZE_WHITESPACE"