Skip to content

Commit b9dfeb5

Browse files
authored
Tests: Python 3.12 enable warnings as errors (#1027)
1 parent a358e08 commit b9dfeb5

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

testkit/_common.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ def get_python_version():
4141

4242
def run_python(args, env=None, warning_as_error=True):
4343
cmd = [TEST_BACKEND_VERSION, "-u"]
44-
if get_python_version() >= (3, 12):
45-
# Ignore warnings for Python 3.12 for now
46-
# https://github.com/dateutil/dateutil/issues/1284 needs to be released
47-
# and propagate through our dependency graph
48-
warning_as_error = False
4944
if warning_as_error:
5045
cmd += ["-W", "error"]
5146
cmd += list(args)

testkitbackend/__main__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ async def main():
4747

4848

4949
if __name__ == "__main__":
50-
if sys.version_info < (3, 12):
51-
# Ignore warnings for Python 3.12 for now
52-
# https://github.com/dateutil/dateutil/issues/1284 needs to be released
53-
# and propagate through our dependency graph
54-
warnings.simplefilter("error")
50+
warnings.simplefilter("error")
5551
if len(sys.argv) == 2 and sys.argv[1].lower().strip() == "async":
5652
async_main()
5753
else:

tox.ini

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ passenv = TEST_NEO4J_*
66
deps = -r requirements-dev.txt
77
setenv = COVERAGE_FILE={envdir}/.coverage
88
usedevelop = true
9-
# Ignore warnings for Python 3.12 for now
10-
# https://github.com/dateutil/dateutil/issues/1284 needs to be released
11-
# and propagate through our dependency graph
129
warnargs =
13-
py{37,38,39,310,311}: -W error
14-
py312:
10+
py{37,38,39,310,311,312}: -W error
1511
commands =
1612
coverage erase
1713
unit: coverage run -m pytest {[testenv]warnargs} -v {posargs} tests/unit

0 commit comments

Comments
 (0)