Merge lp:~toshio/mailman/py2.6 into lp:mailman

Proposed by Toshio Kuratomi
Status: Rejected
Rejected by: Barry Warsaw
Proposed branch: lp:~toshio/mailman/py2.6
Merge into: lp:mailman
Diff against target: 23 lines (+6/-4)
1 file modified
src/mailman/archiving/tests/test_prototype.py (+6/-4)
To merge this branch: bzr merge lp:~toshio/mailman/py2.6
Reviewer Review Type Date Requested Status
Mailman Coders Pending
Review via email: mp+97707@code.launchpad.net

Description of the change

Fix unittest to take into account incompatibile output between python2.6 and python2.7 logging module

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

I just fixed this in a different way, not to be confused with the *right* way. ;)

Unmerged revisions

7119. By toshio <email address hidden>

Make my comment about the nature of this fix slightly better

7118. By toshio <email address hidden>

Fix an incompatibility between python2.6 and python2.7 for the prototype archiver unittests

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/mailman/archiving/tests/test_prototype.py'
2--- src/mailman/archiving/tests/test_prototype.py 2012-03-14 23:44:30 +0000
3+++ src/mailman/archiving/tests/test_prototype.py 2012-03-15 17:40:24 +0000
4@@ -150,13 +150,15 @@
5 archive_thread.run()
6 # Test that the archiver output the correct error.
7 line = mark.readline()
8- self.assertEqual(
9- # Strip out the timestamp.
10- line[28:-1],
11+ # Use endswith() so that we ignore timestamp.
12+ # Offsets don't work because of slightly differently formatted
13+ # output between python2.6 and python2.7
14+ self.assertTrue(
15+ line.strip().endswith(
16 'Unable to acquire prototype archiver lock for {0}, '
17 'discarding: {1}'.format(
18 self._mlist.fqdn_listname,
19- self._msg.get('message-id')))
20+ self._msg.get('message-id'))))
21 # Check that the message didn't get archived.
22 created_files = self._find(config.ARCHIVE_DIR)
23 self.assertEqual(self._expected_dir_structure, created_files)