From f8e0c244a98cc2533d953407e345a7a0977bf3ac Mon Sep 17 00:00:00 2001 From: thorbjoernl <51087536+thorbjoernl@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:41:22 +0100 Subject: [PATCH 1/4] Setup doctest testing --- conftest.py | 6 ++++++ pyproject.toml | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 000000000..49e26c88b --- /dev/null +++ b/conftest.py @@ -0,0 +1,6 @@ +# Root level conftest to ignore scripts folder in doctests. +def pytest_ignore_collect(path): + if "scripts/" in str(path): + return True + if "docs/" in str(path): + return True diff --git a/pyproject.toml b/pyproject.toml index ea8877409..d03f013f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,7 @@ dependencies = [ "pyaro>=0.0.14", "pooch>=1.7.0", "psutil>=5.0.0", + "geopy" ] [project.readme] @@ -209,7 +210,7 @@ commands_pre = python --version python -m pip freeze --all commands = - python -m pytest -ra -q {posargs:--cov --no-cov-on-fail} + python -m pytest -ra -q {posargs:--cov --no-cov-on-fail} --doctest-modules extras = test setenv = From 645f30c8102795418f7a815479effa71b4b69963 Mon Sep 17 00:00:00 2001 From: thorbjoernl <51087536+thorbjoernl@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:56:12 +0100 Subject: [PATCH 2/4] . --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d03f013f5..06d5f45da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -210,7 +210,7 @@ commands_pre = python --version python -m pip freeze --all commands = - python -m pytest -ra -q {posargs:--cov --no-cov-on-fail} --doctest-modules + python -m pytest -ra -q {posargs:--cov --no-cov-on-fail --doctest-modules} extras = test setenv = From eb93541c07b91ca101976a2152532cc443b9bec0 Mon Sep 17 00:00:00 2001 From: thorbjoernl <51087536+thorbjoernl@users.noreply.github.com> Date: Tue, 3 Dec 2024 11:59:33 +0100 Subject: [PATCH 3/4] . --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 06d5f45da..56ef97369 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -210,7 +210,7 @@ commands_pre = python --version python -m pip freeze --all commands = - python -m pytest -ra -q {posargs:--cov --no-cov-on-fail --doctest-modules} + python -m pytest --doctest-modules -ra -q {posargs:--cov --no-cov-on-fail} extras = test setenv = From b1d9b2d82e7655e503b2a70fd9c91a44b213c84d Mon Sep 17 00:00:00 2001 From: thorbjoernl <51087536+thorbjoernl@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:42:04 +0100 Subject: [PATCH 4/4] . --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 56ef97369..ec01f691b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -210,7 +210,7 @@ commands_pre = python --version python -m pip freeze --all commands = - python -m pytest --doctest-modules -ra -q {posargs:--cov --no-cov-on-fail} + python -m pytest --doctest-modules . -ra -q {posargs:--cov --no-cov-on-fail} extras = test setenv =