[Zope3-checkins] SVN: zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner- Fixed tests to run on Python 2.7, too (fix taken from zope.testrunner)
Michael Howitz
mh at gocept.com
Mon Feb 21 07:53:04 EST 2011
Log message for revision 120498:
Fixed tests to run on Python 2.7, too (fix taken from zope.testrunner)
Changed:
U zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-debugging.txt
U zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-ex/sample3/sampletests_d.py
-=-
Modified: zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-debugging.txt
===================================================================
--- zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-debugging.txt 2011-02-21 12:51:30 UTC (rev 120497)
+++ zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-debugging.txt 2011-02-21 12:53:04 UTC (rev 120498)
@@ -84,7 +84,7 @@
In the example above, we debugged an error. Failures are actually
converted to errors and can be debugged the same way:
- >>> sys.stdin = Input('up\np x\np y\nc')
+ >>> sys.stdin = Input('p x\np y\nc')
>>> sys.argv = ('test -ssample3 --tests-pattern ^sampletests_d$'
... ' -t post_mortem_failure1 -D').split()
>>> try: testrunner.run_internal(defaults)
@@ -98,18 +98,13 @@
getattr(self, self.__testMethodName)()
File "testrunner-ex/sample3/sampletests_d.py",
line 42, in test_post_mortem_failure1
- self.assertEqual(x, y)
- File ".../unittest.py", line 302, in failUnlessEqual
- raise self.failureException, \
- AssertionError: 1 != 2
+ assert x == y
+ AssertionError
<BLANKLINE>
- exceptions.AssertionError:
- 1 != 2
- > .../unittest.py(302)failUnlessEqual()
- -> ...
- (Pdb) up
+ ...AssertionError:
+ <BLANKLINE>
> testrunner-ex/sample3/sampletests_d.py(42)test_post_mortem_failure1()
- -> self.assertEqual(x, y)
+ -> assert x == y
(Pdb) p x
1
(Pdb) p y
Modified: zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-ex/sample3/sampletests_d.py
===================================================================
--- zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-ex/sample3/sampletests_d.py 2011-02-21 12:51:30 UTC (rev 120497)
+++ zope.testing/branches/3.9/src/zope/testing/testrunner/testrunner-ex/sample3/sampletests_d.py 2011-02-21 12:53:04 UTC (rev 120498)
@@ -39,7 +39,7 @@
def test_post_mortem_failure1(self):
x = 1
y = 2
- self.assertEqual(x, y)
+ assert x == y
def f():
x = 1
More information about the Zope3-Checkins
mailing list