Merge lp:~jayvdb/testscenarios/fix-py3-tests into lp:~testtools-committers/testscenarios/trunk

Proposed by John Vandenberg
Status: Merged
Merge reported by: Robert Collins
Merged at revision: not available
Proposed branch: lp:~jayvdb/testscenarios/fix-py3-tests
Merge into: lp:~testtools-committers/testscenarios/trunk
Prerequisite: lp:~jayvdb/testscenarios/0.4
Diff against target: 29 lines (+3/-9)
1 file modified
lib/testscenarios/tests/test_testcase.py (+3/-9)
To merge this branch: bzr merge lp:~jayvdb/testscenarios/fix-py3-tests
Reviewer Review Type Date Requested Status
testtools committers Pending
Review via email: mp+257474@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

Thanks for spotting this. assertTrue has the downside that its very hard to diagnose failures, so I fixed this using EndsWith instead. Also found other cases in 3.5 that broke too, so fixed them as well. Have pushed the fixes to trunk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/testscenarios/tests/test_testcase.py'
2--- lib/testscenarios/tests/test_testcase.py 2012-04-04 10:45:22 +0000
3+++ lib/testscenarios/tests/test_testcase.py 2015-04-26 05:03:14 +0000
4@@ -55,9 +55,7 @@
5 test.run(result)
6 self.assertTrue(result.wasSuccessful())
7 self.assertEqual(1, result.testsRun)
8- self.assertEqual(
9- 'testscenarios.tests.test_testcase.ReferenceTest.test_pass(demo)',
10- log[0][1].id())
11+ self.assertTrue(log[0][1].id().endswith('ReferenceTest.test_pass(demo)'))
12
13 def test_with_two_scenarios_two_run(self):
14 class ReferenceTest(self.Implementation):
15@@ -70,12 +68,8 @@
16 test.run(result)
17 self.assertTrue(result.wasSuccessful())
18 self.assertEqual(2, result.testsRun)
19- self.assertEqual(
20- 'testscenarios.tests.test_testcase.ReferenceTest.test_pass(1)',
21- log[0][1].id())
22- self.assertEqual(
23- 'testscenarios.tests.test_testcase.ReferenceTest.test_pass(2)',
24- log[4][1].id())
25+ self.assertTrue(log[0][1].id().endswith('ReferenceTest.test_pass(1)'))
26+ self.assertTrue(log[4][1].id().endswith('ReferenceTest.test_pass(2)'))
27
28 def test_attributes_set(self):
29 class ReferenceTest(self.Implementation):

Subscribers

People subscribed via source and target branches