Replace MockLoggers in tests with fixtures.FakeLogger

Bug #125637 reported by Brad Crittenden
10
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

Many places in our tests we locally define a MockLogger class. There exist two classes in Zope to support testing log output in tests.

Quote flacoste:

"There is zope.testing.loggingsupport.InstalledHandler which is best used from doctest.

And there is also zope.testing.loghandler.Handler which is meant to be used with TestCase subclasses.

Both of these work with the logging framework."

We should no longer be locally defining MockLogger classes and those currently in use should be replaced with the appropriate zope handler.

NOTE: MockLoggers have been removed and now we have FakeLoggers and subclasses in lp.services.log.logger.

Changed in launchpad:
status: New → Confirmed
description: updated
Changed in launchpad:
importance: Undecided → Medium
summary: - Replace MockLoggers in tests with zope utilities
+ Replace MockLoggers in tests with zope handlers
Tim Penhey (thumper)
description: updated
Changed in launchpad:
importance: Medium → High
Revision history for this message
Robert Collins (lifeless) wrote : Re: Replace MockLoggers in tests with zope handlers

There is now a fixture in Fixtures (FakeLogger) which should supercede -all- of the ones we have.

summary: - Replace MockLoggers in tests with zope handlers
+ Replace MockLoggers in tests with fixtures.FakeLogger
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

After grepping the source code today, I'm reasonably confident that this has been done, and this bug can be closed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.