From e97a3c1511fc42c1e58e23e93ccb0a4490f69654 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Sat, 15 Nov 2025 19:25:03 +0000 Subject: [PATCH 1/4] Stop requiring pytest-subtests, it has been incorporated into pytest. --- tests/test_contents.py | 18 ------------------ tox.ini | 1 - 2 files changed, 19 deletions(-) diff --git a/tests/test_contents.py b/tests/test_contents.py index 4cfbb3a..35e5714 100644 --- a/tests/test_contents.py +++ b/tests/test_contents.py @@ -8,24 +8,6 @@ import importlib_resources as resources -if sys.version_info < (3, 6): - # pytest-subtests does not support Python < 3.6, but having the tests - # separated into clean subtests is nice but not required, so we will create - # a stub that does nothing but at least doesn't fail for lack of a fixture. - import contextlib - - class _SubTestStub: - @contextlib.contextmanager - def test(self, **kwargs): - yield - - _sub_test_stub = _SubTestStub() - - @pytest.fixture - def subtests(): - yield _sub_test_stub - - def get_magic(zone_name): components = zone_name.split("/") package_name = ".".join(["tzdata.zoneinfo"] + components[:-1]) diff --git a/tox.ini b/tox.ini index 8516ee4..d0f338a 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,6 @@ skip_missing_interpreters = true description = Test that the tzdata contents are accessible deps = pytest - pytest-subtests; python_version>='3.6' importlib_resources; python_version<'3.7' commands = pytest {toxinidir} {posargs} From 2c512f1f26714c76bad9597e351e6a9db5578f84 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Sat, 15 Nov 2025 19:29:53 +0000 Subject: [PATCH 2/4] Revert "Stop requiring pytest-subtests, it has been incorporated into pytest." This reverts commit e97a3c1511fc42c1e58e23e93ccb0a4490f69654. --- tests/test_contents.py | 18 ++++++++++++++++++ tox.ini | 1 + 2 files changed, 19 insertions(+) diff --git a/tests/test_contents.py b/tests/test_contents.py index 35e5714..4cfbb3a 100644 --- a/tests/test_contents.py +++ b/tests/test_contents.py @@ -8,6 +8,24 @@ import importlib_resources as resources +if sys.version_info < (3, 6): + # pytest-subtests does not support Python < 3.6, but having the tests + # separated into clean subtests is nice but not required, so we will create + # a stub that does nothing but at least doesn't fail for lack of a fixture. + import contextlib + + class _SubTestStub: + @contextlib.contextmanager + def test(self, **kwargs): + yield + + _sub_test_stub = _SubTestStub() + + @pytest.fixture + def subtests(): + yield _sub_test_stub + + def get_magic(zone_name): components = zone_name.split("/") package_name = ".".join(["tzdata.zoneinfo"] + components[:-1]) diff --git a/tox.ini b/tox.ini index d0f338a..8516ee4 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ skip_missing_interpreters = true description = Test that the tzdata contents are accessible deps = pytest + pytest-subtests; python_version>='3.6' importlib_resources; python_version<'3.7' commands = pytest {toxinidir} {posargs} From 59ab126fa2faf3258e652ca32efaed59a130d04d Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Sat, 15 Nov 2025 19:31:23 +0000 Subject: [PATCH 3/4] We have to keep it anyway for 3.6, 3.7, 3.8, 3.9 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8516ee4..aef5628 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ skip_missing_interpreters = true description = Test that the tzdata contents are accessible deps = pytest - pytest-subtests; python_version>='3.6' + pytest-subtests; python_version >= '3.6' and python_version <= '3.9' importlib_resources; python_version<'3.7' commands = pytest {toxinidir} {posargs} From 5a887cb6ae9fa92525cbd01a7b0b2cb4aa06cd5d Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Sat, 15 Nov 2025 19:41:19 +0000 Subject: [PATCH 4/4] Ensure pytest >= 9 --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index aef5628..83e7708 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,8 @@ skip_missing_interpreters = true [testenv] description = Test that the tzdata contents are accessible deps = - pytest + pytest >= 9; python_version >= '3.10' + pytest; python_version < '3.10' pytest-subtests; python_version >= '3.6' and python_version <= '3.9' importlib_resources; python_version<'3.7' commands =