TypeError: If post_mortem is specified, full exc_info must be passed!

Bug #1119363 reported by Marius Gedminas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zope.testrunner
Fix Released
Undecided
Marius Gedminas

Bug Description

If you have a test module that cannot be imported or has no tests *and* run zope-testrunner -D, you get this error:

Traceback (most recent call last):
  File "bin/test", line 20, in <module>
    '--test-path', '/home/mg/src/zope.testrunner/src',
  File "/home/mg/src/zope.testrunner/src/zope/testrunner/__init__.py", line 30, in run
    failed = run_internal(defaults, args, script_parts=script_parts)
  File "/home/mg/src/zope.testrunner/src/zope/testrunner/__init__.py", line 43, in run_internal
    runner.run()
  File "/home/mg/src/zope.testrunner/src/zope/testrunner/runner.py", line 136, in run
    feature.global_setup()
  File "/home/mg/src/zope.testrunner/src/zope/testrunner/find.py", line 477, in global_setup
    tests = find_tests(self.runner.options, self.runner.found_suites)
  File "/home/mg/src/zope.testrunner/src/zope/testrunner/find.py", line 163, in find_tests
    for suite in found_suites:
  File "/home/mg/src/zope.testrunner/src/zope/testrunner/find.py", line 198, in find_suites
    + (sys.exc_info()[2].tb_next.tb_next,),
  File "/home/mg/src/zope.testrunner/src/zope/testrunner/find.py", line 131, in __init__
    raise TypeError('If post_mortem is specified, '
TypeError: If post_mortem is specified, full exc_info must be passed!

To reproduce:
    check out zope.testrunner
    python bootstrap.py
    bin/buildout
    edit src/zope/testrunner/tests.py and introduce a syntax error
    bin/test -D

Changed in zope.testrunner:
status: New → In Progress
assignee: nobody → Marius Gedminas (mgedmin)
Revision history for this message
Marius Gedminas (mgedmin) wrote :

A related but different bug: instead of a syntax error (that would raise during import time) cause an invalid test_suite to be returned (e.g. return None) and try bin/test -D. Same error, different place.

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

Other bug subscribers

Remote bug watches

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