Test failure under Python 2.7

Bug #605455 reported by Tres Seaver
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zope.testing
Invalid
Undecided
Unassigned

Bug Description

Running zope.testing's own tests under Python 2.7 fails, because the unittest module
has been significanly refactored:

 $ svn co svn+ssh://svn.zope.org/repos/main/zope.testing/trunk zope.testing
 ...
 $ cd zope.testing
 $ /opt/Python-2.7.0/bin/python bootstrap.py
 ...
 $ bin/buildout
 ...
 $ bin/test --all
 Running zope.testing.testrunner.layer.UnitTests tests:
   Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds.

 Failure in test /tmp/zt/src/zope/testing/testrunner/testrunner-debugging.txt
 Failed doctest test for testrunner-debugging.txt
   File "/tmp/zt/src/zope/testing/testrunner/testrunner-debugging.txt", line 0

 ----------------------------------------------------------------------
 File "/tmp/zt/src/zope/testing/testrunner/testrunner-debugging.txt", line 90, in testrunner-debugging.txt
 Failed example:
     try: testrunner.run_internal(defaults)
     finally: sys.stdin = real_stdin
     # doctest: +NORMALIZE_WHITESPACE +REPORT_NDIFF
 Differences (ndiff with -expected +actual):
       Running zope.testing.testrunner.layer.UnitTests tests:
     - ...
     + Set up zope.testing.testrunner.layer.UnitTests in N.NNN seconds.
     + <BLANKLINE>
     + <BLANKLINE>
       Error in test test_post_mortem_failure1 (sample3.sampletests_d.TestSomething)
       Traceback (most recent call last):
     + testrunner-ex/sample3/sampletests_d.py", Line NNN, in test_post_mortem_failure1
     - testrunner-ex/sample3/sampletests_d.py",
     - Line NNN, in test_post_mortem_failure1
           self.assertEqual(x, y)
       AssertionError: 1 != 2
       <BLANKLINE>
       exceptions.AssertionError:
       1 != 2
     - unittest.py(NNN)failUnlessEqual()
     - -> ...
     + > /opt/Python-2.7.0/lib/python2.7/unittest/case.py(NNN)_baseAssertEqual()
     + -> raise self.failureException(msg)
       (Pdb) up
     - > testrunner-ex/sample3/sampletests_d.py(NNN)test_post_mortem_failure1()
     - -> self.assertEqual(x, y)
     + > /opt/Python-2.7.0/lib/python2.7/unittest/case.py(NNN)assertEqual()
     + -> assertion_func(first, second, msg=msg)
       (Pdb) p x
     - 1
     + *** NameError: NameError("name 'x' is not defined",)
       (Pdb) p y
     - 2
     + *** NameError: NameError("name 'y' is not defined",)
       (Pdb) c
       True

   Ran 261 tests with 1 failures and 0 errors in 22.154 seconds.
 Tearing down left over layers:
   Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds.

Revision history for this message
Tres Seaver (tseaver) wrote :

I made an unsuccessful stab at fixing this issue by replacing the
stdlib 'assertEqual' method with one defined locally on the testcase.
Maybe somebody else can use the attached patch as a starting point.

Revision history for this message
Alex Smith (ajsmith) wrote :

The tests have been fixed on the trunk as of r117136.

Tres Seaver (tseaver)
Changed in zope.testing:
status: New → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope.testing project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope.testing.

Changed in zope.testing:
status: Fix Committed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.