Opened 2 years ago

Last modified 2 years ago

#5946 enhancement new

Almost all twisted.test.test_log tests should use custom LogPublisher instance, rather than global publisher

Reported by: itamar Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: exarkun Branch:
Author: Launchpad Bug:

Description

Some test_log create a new LogPublisher for their tests; this is useful among other reasons because it doesn't require TestCase.flushLoggedErrors because there's no interaction with global logging state. There are some existing tests that don't do so, and should be ported.

This may require moving functionality from twisted.python.log.err to twisted.python.log.LogPublisher.err.

Change History (1)

comment:1 Changed 2 years ago by itamar

  • Cc exarkun added

Also, it looks like a number of tests in test_log don't clean up well after themselves, changing global log state. In particular the ones using log.startLogging, but quite possibly others as well. This is causing erroneous test errors on Python 3. Disabling test case by test case should find out which; possibly that problem won't require this whole ticket, or will involve code not in LogPublisher.

Note: See TracTickets for help on using tickets.