From 1687a3b835294fc072c74a5b2737c7efba28e3c7 Mon Sep 17 00:00:00 2001 From: Robsdedude Date: Wed, 6 Mar 2024 16:48:03 +0100 Subject: [PATCH] Tests: Python 3.12 enable warnings as errors --- testkit/_common.py | 5 ----- testkitbackend/__main__.py | 6 +----- tox.ini | 6 +----- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/testkit/_common.py b/testkit/_common.py index 19ecf1d68..d08bfa8d4 100644 --- a/testkit/_common.py +++ b/testkit/_common.py @@ -41,11 +41,6 @@ def get_python_version(): def run_python(args, env=None, warning_as_error=True): cmd = [TEST_BACKEND_VERSION, "-u"] - if get_python_version() >= (3, 12): - # Ignore warnings for Python 3.12 for now - # https://github.com/dateutil/dateutil/issues/1284 needs to be released - # and propagate through our dependency graph - warning_as_error = False if warning_as_error: cmd += ["-W", "error"] cmd += list(args) diff --git a/testkitbackend/__main__.py b/testkitbackend/__main__.py index 535712bb5..74c71441a 100644 --- a/testkitbackend/__main__.py +++ b/testkitbackend/__main__.py @@ -47,11 +47,7 @@ async def main(): if __name__ == "__main__": - if sys.version_info < (3, 12): - # Ignore warnings for Python 3.12 for now - # https://github.com/dateutil/dateutil/issues/1284 needs to be released - # and propagate through our dependency graph - warnings.simplefilter("error") + warnings.simplefilter("error") if len(sys.argv) == 2 and sys.argv[1].lower().strip() == "async": async_main() else: diff --git a/tox.ini b/tox.ini index 73e9db620..d75274c2e 100644 --- a/tox.ini +++ b/tox.ini @@ -6,12 +6,8 @@ passenv = TEST_NEO4J_* deps = -r requirements-dev.txt setenv = COVERAGE_FILE={envdir}/.coverage usedevelop = true -# Ignore warnings for Python 3.12 for now -# https://github.com/dateutil/dateutil/issues/1284 needs to be released -# and propagate through our dependency graph warnargs = - py{37,38,39,310,311}: -W error - py312: + py{37,38,39,310,311,312}: -W error commands = coverage erase unit: coverage run -m pytest {[testenv]warnargs} -v {posargs} tests/unit