Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[meta] Remove DeprecationWarning from twisted own tests #10149

Closed
twisted-trac opened this issue Mar 23, 2021 · 1 comment · Fixed by #11712
Closed

[meta] Remove DeprecationWarning from twisted own tests #10149

twisted-trac opened this issue Mar 23, 2021 · 1 comment · Fixed by #11712

Comments

@twisted-trac
Copy link

adiroiban's avatar @adiroiban reported
Trac ID trac#10149
Type task
Created 2021-03-23 23:26:21Z

The twisted own test suite should not use deprecated code.

My reasoning is as follows.

When a PR is created to deprecated some API, the PR will take care of replacing all usage of that API in Twisted itself.

Then, when it's time to remove the deprecated API, the PR to remove the code will just need to remove the API and will not have to see how to replace the API in the current code base.

Later, we might have a CI check to make sure the test will not introduce new DeprecationsWarnings

This is the meta ticket which shows the current state.

Separeate tickets should be created for each deprecated API/warning

$ python3 -Wall -m twisted.trial -n twisted > /dev/null


/home/adi/chevah/twisted/.tox/build3/lib/python3.9/site-packages/unittest2/compatibility.py:143: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
  class ChainMap(collections.MutableMapping):
/home/adi/chevah/twisted/src/twisted/application/test/test_internet.py:38: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/application/twist/test/test_options.py:22: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor
/home/adi/chevah/twisted/src/twisted/application/twist/test/test_twist.py:13: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor
/home/adi/chevah/twisted/src/twisted/test/test_twistd.py:42: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor
/home/adi/chevah/twisted/src/twisted/conch/test/test_cftp.py:33: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/conch/test/test_channel.py:19: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/conch/scripts/ckeygen.py:15: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  from imp import reload
/home/adi/chevah/twisted/src/twisted/conch/test/test_default.py:17: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/conch/test/test_endpoints.py:29: DeprecationWarning: twisted.test.proto_helpers.EventLoggingObserver was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.EventLoggingObserver instead.
  from twisted.test.proto_helpers import EventLoggingObserver, MemoryReactorClock
/home/adi/chevah/twisted/src/twisted/conch/test/test_endpoints.py:29: DeprecationWarning: twisted.test.proto_helpers.MemoryReactorClock was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactorClock instead.
  from twisted.test.proto_helpers import EventLoggingObserver, MemoryReactorClock
/home/adi/chevah/twisted/src/twisted/conch/test/test_endpoints.py:80: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/conch/test/test_forwarding.py:18: DeprecationWarning: twisted.test.proto_helpers.MemoryReactorClock was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactorClock instead.
  from twisted.test.proto_helpers import MemoryReactorClock, StringTransport
/home/adi/chevah/twisted/src/twisted/conch/test/test_forwarding.py:18: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import MemoryReactorClock, StringTransport
/home/adi/chevah/twisted/src/twisted/conch/test/test_insults.py:8: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/conch/test/test_manhole.py:18: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/conch/test/test_recvline.py:23: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/conch/test/test_mixin.py:6: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/test/test_tcp.py:29: DeprecationWarning: twisted.test.proto_helpers.AccumulatingProtocol was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.AccumulatingProtocol instead.
  from twisted.test.proto_helpers import AccumulatingProtocol
/home/adi/chevah/twisted/src/twisted/internet/test/test_tcp.py:95: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor, StringTransport
/home/adi/chevah/twisted/src/twisted/internet/test/test_tcp.py:95: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import MemoryReactor, StringTransport
/home/adi/chevah/twisted/src/twisted/internet/test/test_protocol.py:31: DeprecationWarning: twisted.test.proto_helpers.MemoryReactorClock was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactorClock instead.
  from twisted.test.proto_helpers import MemoryReactorClock, StringTransport
/home/adi/chevah/twisted/src/twisted/internet/test/test_protocol.py:31: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import MemoryReactorClock, StringTransport
/home/adi/chevah/twisted/src/twisted/mail/test/test_imap.py:53: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport, StringTransportWithDisconnection
/home/adi/chevah/twisted/src/twisted/mail/test/test_imap.py:53: DeprecationWarning: twisted.test.proto_helpers.StringTransportWithDisconnection was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransportWithDisconnection instead.
  from twisted.test.proto_helpers import StringTransport, StringTransportWithDisconnection
/home/adi/chevah/twisted/src/twisted/mail/test/test_mail.py:53: DeprecationWarning: twisted.test.proto_helpers.LineSendingProtocol was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.LineSendingProtocol instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/mail/test/test_mail.py:53: DeprecationWarning: twisted.test.proto_helpers.MemoryReactorClock was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactorClock instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/mail/test/test_mail.py:53: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/mail/test/test_mailmail.py:22: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor
/home/adi/chevah/twisted/src/twisted/mail/test/test_pop3.py:26: DeprecationWarning: twisted.test.proto_helpers.LineSendingProtocol was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.LineSendingProtocol instead.
  from twisted.test.proto_helpers import LineSendingProtocol
/home/adi/chevah/twisted/src/twisted/mail/test/test_pop3client.py:21: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/mail/test/test_smtp.py:24: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor, StringTransport
/home/adi/chevah/twisted/src/twisted/mail/test/test_smtp.py:24: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import MemoryReactor, StringTransport
/home/adi/chevah/twisted/src/twisted/names/test/test_names.py:29: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/names/test/test_names.py:29: DeprecationWarning: twisted.test.proto_helpers.MemoryReactorClock was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactorClock instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/names/test/test_names.py:29: DeprecationWarning: twisted.test.proto_helpers.waitUntilAllDisconnected was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.waitUntilAllDisconnected instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/names/test/test_srvconnect.py:21: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor
/home/adi/chevah/twisted/src/twisted/protocols/haproxy/test/test_parser.py:9: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor
/home/adi/chevah/twisted/src/twisted/protocols/haproxy/test/test_wrapper.py:11: DeprecationWarning: twisted.test.proto_helpers.StringTransportWithDisconnection was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransportWithDisconnection instead.
  from twisted.test.proto_helpers import StringTransportWithDisconnection
/home/adi/chevah/twisted/src/twisted/protocols/test/test_tls.py:66: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport, NonStreamingProducer
/home/adi/chevah/twisted/src/twisted/protocols/test/test_tls.py:66: DeprecationWarning: twisted.test.proto_helpers.NonStreamingProducer was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.NonStreamingProducer instead.
  from twisted.test.proto_helpers import StringTransport, NonStreamingProducer
/home/adi/chevah/twisted/src/twisted/runner/test/test_procmon.py:15: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor
/home/adi/chevah/twisted/src/twisted/spread/test/test_banana.py:14: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/spread/test/test_jelly.py:16: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/spread/test/test_pb.py:37: DeprecationWarning: twisted.test.proto_helpers._FakeConnector was deprecated in Twisted 19.7.0: Please use twisted.internet.testing._FakeConnector instead.
  from twisted.test.proto_helpers import _FakeConnector
/home/adi/chevah/twisted/src/twisted/test/test_amp.py:23: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/test/test_application.py:31: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor
/home/adi/chevah/twisted/src/twisted/test/test_dict.py:7: DeprecationWarning: twisted.protocols.dict was deprecated in Twisted 17.9.0: There is no replacement for this module.
  from twisted.protocols import dict
/home/adi/chevah/twisted/src/twisted/test/test_finger.py:10: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/test/test_ident.py:19: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/test/test_memcache.py:15: DeprecationWarning: twisted.test.proto_helpers.StringTransportWithDisconnection was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransportWithDisconnection instead.
  from twisted.test.proto_helpers import StringTransportWithDisconnection
/home/adi/chevah/twisted/src/twisted/test/test_policies.py:14: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/test/test_policies.py:15: DeprecationWarning: twisted.test.proto_helpers.StringTransportWithDisconnection was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransportWithDisconnection instead.
  from twisted.test.proto_helpers import StringTransportWithDisconnection
/home/adi/chevah/twisted/src/twisted/test/test_postfix.py:11: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/test/test_ssl.py:15: DeprecationWarning: twisted.test.proto_helpers.waitUntilAllDisconnected was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.waitUntilAllDisconnected instead.
  from twisted.test.proto_helpers import waitUntilAllDisconnected
/home/adi/chevah/twisted/src/twisted/trial/_dist/test/test_disttrial.py:21: DeprecationWarning: twisted.test.proto_helpers.MemoryReactorClock was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactorClock instead.
  from twisted.test.proto_helpers import MemoryReactorClock
/home/adi/chevah/twisted/src/twisted/trial/_dist/test/test_worker.py:24: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/home/adi/chevah/twisted/src/twisted/trial/_dist/test/test_workertrial.py:15: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
/usr/lib/python3.9/inspect.py:351: DeprecationWarning: twisted.trial.test.test_assertions.somethingOld was deprecated in Bar 1.2.3: It's old and clunky
  value = getattr(object, key)
/home/adi/chevah/twisted/src/twisted/web/test/test_agent.py:23: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_agent.py:23: DeprecationWarning: twisted.test.proto_helpers.MemoryReactorClock was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactorClock instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_agent.py:23: DeprecationWarning: twisted.test.proto_helpers.EventLoggingObserver was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.EventLoggingObserver instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_agent.py:63: DeprecationWarning: twisted.test.proto_helpers.AccumulatingProtocol was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.AccumulatingProtocol instead.
  from twisted.test.proto_helpers import AccumulatingProtocol
/home/adi/chevah/twisted/src/twisted/web/test/test_web.py:27: DeprecationWarning: twisted.test.proto_helpers.EventLoggingObserver was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.EventLoggingObserver instead.
  from twisted.test.proto_helpers import EventLoggingObserver
/home/adi/chevah/twisted/src/twisted/web/test/test_http.py:42: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_http.py:42: DeprecationWarning: twisted.test.proto_helpers.NonStreamingProducer was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.NonStreamingProducer instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_http.py:42: DeprecationWarning: twisted.test.proto_helpers.EventLoggingObserver was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.EventLoggingObserver instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_httpauth.py:35: DeprecationWarning: twisted.test.proto_helpers.EventLoggingObserver was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.EventLoggingObserver instead.
  from twisted.test.proto_helpers import EventLoggingObserver
/home/adi/chevah/twisted/src/twisted/web/test/test_newclient.py:20: DeprecationWarning: twisted.test.proto_helpers.AccumulatingProtocol was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.AccumulatingProtocol instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_newclient.py:20: DeprecationWarning: twisted.test.proto_helpers.EventLoggingObserver was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.EventLoggingObserver instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_newclient.py:20: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_newclient.py:20: DeprecationWarning: twisted.test.proto_helpers.StringTransportWithDisconnection was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransportWithDisconnection instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_proxy.py:9: DeprecationWarning: twisted.test.proto_helpers.StringTransportWithDisconnection was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransportWithDisconnection instead.
  from twisted.test.proto_helpers import StringTransportWithDisconnection
/home/adi/chevah/twisted/src/twisted/web/test/test_proxy.py:10: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor
/home/adi/chevah/twisted/src/twisted/web/test/test_template.py:29: DeprecationWarning: twisted.test.proto_helpers.EventLoggingObserver was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.EventLoggingObserver instead.
  from twisted.test.proto_helpers import EventLoggingObserver
/home/adi/chevah/twisted/src/twisted/web/test/test_webclient.py:25: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_webclient.py:25: DeprecationWarning: twisted.test.proto_helpers.waitUntilAllDisconnected was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.waitUntilAllDisconnected instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_webclient.py:25: DeprecationWarning: twisted.test.proto_helpers.EventLoggingObserver was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.EventLoggingObserver instead.
  from twisted.test.proto_helpers import (
/home/adi/chevah/twisted/src/twisted/web/test/test_webclient.py:1631: DeprecationWarning: twisted.web.client.HTTPPageGetter was deprecated in Twisted 16.7.0: please use https://pypi.org/project/treq/ or twisted.web.client.Agent instead
  protocolClass = client.HTTPPageGetter
/home/adi/chevah/twisted/src/twisted/web/test/test_webclient.py:1660: DeprecationWarning: twisted.web.client.HTTPPageGetter was deprecated in Twisted 16.7.0: please use https://pypi.org/project/treq/ or twisted.web.client.Agent instead
  protocolClass = client.HTTPPageGetter
/home/adi/chevah/twisted/src/twisted/web/test/test_webclient.py:1689: DeprecationWarning: twisted.web.client.HTTPPageDownloader was deprecated in Twisted 16.7.0: please use https://pypi.org/project/treq/ or twisted.web.client.Agent instead
  protocolClass = client.HTTPPageDownloader
/home/adi/chevah/twisted/src/twisted/web/test/test_webclient.py:1697: DeprecationWarning: twisted.web.client.HTTPPageDownloader was deprecated in Twisted 16.7.0: please use https://pypi.org/project/treq/ or twisted.web.client.Agent instead
  protocolClass = client.HTTPPageDownloader
/home/adi/chevah/twisted/src/twisted/web/test/test_wsgi.py:29: DeprecationWarning: twisted.test.proto_helpers.EventLoggingObserver was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.EventLoggingObserver instead.
  from twisted.test.proto_helpers import EventLoggingObserver
/home/adi/chevah/twisted/src/twisted/web/test/test_xmlrpc.py:25: DeprecationWarning: twisted.test.proto_helpers.MemoryReactor was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.MemoryReactor instead.
  from twisted.test.proto_helpers import MemoryReactor, EventLoggingObserver
/home/adi/chevah/twisted/src/twisted/web/test/test_xmlrpc.py:25: DeprecationWarning: twisted.test.proto_helpers.EventLoggingObserver was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.EventLoggingObserver instead.
  from twisted.test.proto_helpers import MemoryReactor, EventLoggingObserver
/home/adi/chevah/twisted/src/twisted/words/test/test_irc.py:14: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport, StringIOWithoutClosing
/home/adi/chevah/twisted/src/twisted/words/test/test_irc.py:14: DeprecationWarning: twisted.test.proto_helpers.StringIOWithoutClosing was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringIOWithoutClosing instead.
  from twisted.test.proto_helpers import StringTransport, StringIOWithoutClosing
/home/adi/chevah/twisted/src/twisted/words/test/test_ircsupport.py:8: DeprecationWarning: twisted.test.proto_helpers.StringTransport was deprecated in Twisted 19.7.0: Please use twisted.internet.testing.StringTransport instead.
  from twisted.test.proto_helpers import StringTransport
Searchable metadata
trac-id__10149 10149
type__task task
reporter__adiroiban adiroiban
priority__normal normal
milestone__None None
branch__ 
branch_author__ 
status__new new
resolution__None None
component__core core
keywords__None None
time__1616541981031497 1616541981031497
changetime__1617909473376350 1617909473376350
version__None None
owner__None None

@twisted-trac
Copy link
Author

wiml's avatar @wiml commented

I think a slightly different approach would be better. When Twisted deprecates some public api, it should of course no longer use that code itself. But the now-deprecated code will (hopefully) have tests which exercised it. Those tests should remain, but should be updated to assert that they elicit the expected deprecation warnings. (Perhaps as simple as adding a decorator to the test function.) Other than the (pre-existing) unit tests, of course, nothing in Twisted should be calling into the deprecated code.

Why I like this approach: it's a common pattern to hollow-out a deprecated API so it just calls the replacement API. But we want to ensure that we don't break users of Twisted until after the deprecation period ends and we actually remove the API. Keeping the original tests around helps ensure that we don't break the API without giving users a chance to migrate off of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant