From d75cb60eeb0f361282d3e2f0fc8b3ecc3a98f0e0 Mon Sep 17 00:00:00 2001 From: ohemorange Date: Thu, 21 Aug 2025 11:33:57 -0700 Subject: [PATCH] Clean up warning catching in `pytest.ini` (#10438) Several of these have been fixed, so let's update the requirement if necessary and remove the warning catching. `python-dateutil 2.9.0` was released Feb 29, 2024, so it's not widely packaged in non-EOL major distros yet. `pytest-cov 4.1.0` was released May 24, 2023. Our pinned versions were already higher than these requirements. Alternatively, we could just remove the warnings and not update the minimum requirement, but I think it's nicer to note it in requirements for anyone running our tests, like packagers. We already require `poetry-plugin-export>=1.9.0`. `1.7.0` updated its `requests-toolbelt` requirement to `>=1.0.0`, which is greater than the minimum version needed to remove the warning. --- certbot-ci/pyproject.toml | 2 +- certbot/pyproject.toml | 2 +- pytest.ini | 13 +------------ 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/certbot-ci/pyproject.toml b/certbot-ci/pyproject.toml index bfb665dc8..3d32dee87 100644 --- a/certbot-ci/pyproject.toml +++ b/certbot-ci/pyproject.toml @@ -32,7 +32,7 @@ dependencies = [ # This version is needed for "worker" attributes we currently use like # "workerinput". See https://github.com/pytest-dev/pytest-xdist/pull/268. "pytest-xdist>=1.22.1", - "python-dateutil", + "python-dateutil>=2.9.0", # https://github.com/dateutil/dateutil/issues/1314 # This dependency needs to be added using environment markers to avoid its # installation on Linux. "pywin32>=300 ; sys_platform == \"win32\"", diff --git a/certbot/pyproject.toml b/certbot/pyproject.toml index fb6e6f107..503a9b9f8 100644 --- a/certbot/pyproject.toml +++ b/certbot/pyproject.toml @@ -58,7 +58,7 @@ test = [ "pip", "pylint", "pytest", - "pytest-cov", + "pytest-cov>=4.1.0", # https://github.com/pytest-dev/pytest-cov/pull/558 "pytest-xdist", "ruff", "setuptools", diff --git a/pytest.ini b/pytest.ini index dbc0d77fb..36d39f900 100644 --- a/pytest.ini +++ b/pytest.ini @@ -11,19 +11,8 @@ # we release breaking changes. # # The current warnings being ignored are: -# 1) pytest-cov uses deprecated functionality in pytest-xdist, to be resolved by -# https://github.com/pytest-dev/pytest-cov/issues/557. -# 2) requests-toolbelt<0.10.1 can cause this warning to be raised during our -# unit tests. This warning should be ignored until our (transitive) -# dependency on requests-toolbelt is removed or our pinned version can be -# updated. -# 3) Ignore DeprecationWarning for datetime.utcfromtimestamp() triggered -# from dateutil. See https://github.com/dateutil/dateutil/issues/1314. -# 4) Planning to remove support for checking OCSP via OpenSSL binary. +# 1) Planning to remove support for checking OCSP via OpenSSL binary. # See https://github.com/certbot/certbot/issues/10291. filterwarnings = error - ignore:.*rsyncdir:DeprecationWarning - ignore:'urllib3.contrib.pyopenssl:DeprecationWarning:requests_toolbelt - ignore:.*datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning:dateutil ignore:enforce_openssl_binary_usage parameter is deprecated:DeprecationWarning