Rev 6056: (gz) Accept new style testtools output in bt.test_selftest tests (Martin in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.4/
Patch Queue Manager
pqm at pqm.ubuntu.com
Wed Oct 26 18:28:58 UTC 2011
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/2.4/
------------------------------------------------------------
revno: 6056 [merge]
revision-id: pqm at pqm.ubuntu.com-20111026182858-rod0d0jn5t2j71z9
parent: pqm at pqm.ubuntu.com-20111018073555-xk677r8n7cprtvco
parent: gzlist at googlemail.com-20111026180402-ilgn9xiai2e0biq0
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: 2.4
timestamp: Wed 2011-10-26 18:28:58 +0000
message:
(gz) Accept new style testtools output in bt.test_selftest tests (Martin
Packman)
modified:
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py 2011-07-26 07:30:06 +0000
+++ b/bzrlib/tests/test_selftest.py 2011-10-26 16:42:12 +0000
@@ -1095,7 +1095,10 @@
"FAIL: \\S+\.test_truth\n"
"-+\n"
"(?:.*\n)*"
- "No absolute truth\n"
+ "\\s*(?:Text attachment: )?reason"
+ "(?:\n-+\n|: {{{)"
+ "No absolute truth"
+ "(?:\n-+\n|}}}\n)"
"(?:.*\n)*"
"-+\n"
"Ran 1 test in .*\n"
@@ -1266,10 +1269,10 @@
result = self.run_test_runner(tests.TextTestRunner(stream=out),
FailureWithUnicode("test_log_unicode"))
self.assertContainsRe(out.getvalue(),
- "Text attachment: log\n"
- "-+\n"
- "\d+\.\d+ \\\\u2606\n"
- "-+\n")
+ "(?:Text attachment: )?log"
+ "(?:\n-+\n|: {{{)"
+ "\d+\.\d+ \\\\u2606"
+ "(?:\n-+\n|}}}\n)")
class SampleTestCase(tests.TestCase):
@@ -1754,14 +1757,16 @@
result = self._run_test('test_fail')
self.assertEqual(1, len(result.failures))
result_content = result.failures[0][1]
- self.assertContainsRe(result_content, 'Text attachment: log')
+ self.assertContainsRe(result_content,
+ '(?m)^(?:Text attachment: )?log(?:$|: )')
self.assertContainsRe(result_content, 'this was a failing test')
def test_error_has_log(self):
result = self._run_test('test_error')
self.assertEqual(1, len(result.errors))
result_content = result.errors[0][1]
- self.assertContainsRe(result_content, 'Text attachment: log')
+ self.assertContainsRe(result_content,
+ '(?m)^(?:Text attachment: )?log(?:$|: )')
self.assertContainsRe(result_content, 'this test errored')
def test_skip_has_no_log(self):
@@ -1786,7 +1791,8 @@
result = self._run_test('test_xfail')
self.assertEqual(1, len(result.expectedFailures))
result_content = result.expectedFailures[0][1]
- self.assertNotContainsRe(result_content, 'Text attachment: log')
+ self.assertNotContainsRe(result_content,
+ '(?m)^(?:Text attachment: )?log(?:$|: )')
self.assertNotContainsRe(result_content, 'test with expected failure')
def test_unexpected_success_has_log(self):
@@ -2201,7 +2207,8 @@
self.assertNotContainsRe(content, 'test with expected failure')
self.assertEqual(1, len(result.expectedFailures))
result_content = result.expectedFailures[0][1]
- self.assertNotContainsRe(result_content, 'Text attachment: log')
+ self.assertNotContainsRe(result_content,
+ '(?m)^(?:Text attachment: )?log(?:$|: )')
self.assertNotContainsRe(result_content, 'test with expected failure')
def test_unexpected_success_has_log(self):
=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt 2011-08-24 09:34:35 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt 2011-10-26 18:04:02 +0000
@@ -75,6 +75,9 @@
suite. This can include new facilities for writing tests, fixes to
spurious test failures and changes to the way things should be tested.
+* Accept both old and new style testtools output in selftest tests.
+ (Jelmer Vernooij, Martin Packman, #815423)
+
* Fix the race for TestingThreadingTCPServer in
test_server_crash_while_responding. (Vincent Ladeuil, #869366)
More information about the bazaar-commits
mailing list