Merge lp:~gz/launchpad/py27_test_scriptmonitor_logging_1017981 into lp:launchpad

Proposed by Martin Packman
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 15505
Proposed branch: lp:~gz/launchpad/py27_test_scriptmonitor_logging_1017981
Merge into: lp:launchpad
Diff against target: 12 lines (+1/-1)
1 file modified
lib/lp/scripts/tests/test_scriptmonitor.py (+1/-1)
To merge this branch: bzr merge lp:~gz/launchpad/py27_test_scriptmonitor_logging_1017981
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+112160@code.launchpad.net

Commit message

Fix test_scriptmonitor failures due to Python 2.7 logging module changes

Description of the change

Fix three test failures on python 2.7 from stricter checking of arguments in standard library logging module.

These three tests don't actually care about log output, but create a logger that outputs to /dev/null as well as stderr. By using None instead, the logging to file at least can be skipped. Even less setup could be done by passing in a locally created log object rather than reusing the generic setup.

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/scripts/tests/test_scriptmonitor.py'
2--- lib/lp/scripts/tests/test_scriptmonitor.py 2011-12-30 06:14:56 +0000
3+++ lib/lp/scripts/tests/test_scriptmonitor.py 2012-06-26 16:15:41 +0000
4@@ -22,7 +22,7 @@
5 # sys.args. We don't care about the log messages, so just throw them
6 # away.
7 class FakeOptions:
8- log_file = '/dev/null'
9+ log_file = None
10 loglevel = 1000
11 verbose = False
12 self.con = connect()