Closed whitslack closed 3 years ago
Wow... introduced in 2.6 even... Thanks for pointing this out.
https://docs.python.org/2.7/library/threading.html#threading.current_thread
But, that is in https://github.com/twisted/twisted itself, not pytest-twisted here. I'll go ahead and create a PR over there to keep things moving though and provide a link here in a few minutes.
For the record, as this has not found its way into Twisted yet: you can appease the python-twisted test suite by this patch:
Index: pytest-twisted-1.13.4/pytest.ini
===================================================================
--- pytest-twisted-1.13.4.orig/pytest.ini
+++ pytest-twisted-1.13.4/pytest.ini
@@ -1,3 +1,5 @@
[pytest]
addopts = --verbose
-filterwarnings = error
+filterwarnings =
+ error
+ ignore:currentThread:DeprecationWarning
Index: pytest-twisted-1.13.4/testing/test_basic.py
===================================================================
--- pytest-twisted-1.13.4.orig/testing/test_basic.py
+++ pytest-twisted-1.13.4/testing/test_basic.py
@@ -94,8 +94,13 @@ def skip_if_no_async_generators():
@pytest.fixture
-def cmd_opts(request):
+def cmd_opts(request, testdir):
reactor = request.config.getoption("reactor", "default")
+ pytest_ini_file = """
+ [pytest]
+ filterwarnings = ignore:currentThread:DeprecationWarning
+ """
+ testdir.makefile(".ini", pytest=pytest_ini_file)
return (
sys.executable,
"-m",
@@ -370,6 +375,8 @@ def test_async_fixture(testdir, cmd_opts
[pytest]
markers =
redgreenblue
+ filterwarnings =
+ ignore:currentThread:DeprecationWarning
"""
testdir.makefile('.ini', pytest=pytest_ini_file)
test_file = """
you can appease the python-twisted test suite by this patch
Beautiful! The patch eliminates the test failure on Gentoo with Python 3.10. Thanks, @bnavigator.
When running the tests on Python 3.10, I get failures because of an extra warning in the Pytest output:
The
currentThread()
function was deprecated in Python 3.10.