Skip to content

Instantly share code, notes, and snippets.

@coreypobrien
Created September 3, 2014 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coreypobrien/ca9627e42985006efdab to your computer and use it in GitHub Desktop.
Save coreypobrien/ca9627e42985006efdab to your computer and use it in GitHub Desktop.
Better handling of unexpected topic exceptions for pyvows
============
Vows Results
============
A
B
Error in topic:
integer division or modulo by zero
Traceback (most recent call last):
File "/python/site-packages/pyvows/runner/gevent.py", line 104, in _run_setup_and_topic
topic = topic_func(*topic_list)
File "/testerror.py", line 13, in topic
return 42 / 0
ZeroDivisionError: integer division or modulo by zero
Nested tests following this error have not been run.
✓ OK » 0 honored • 0 broken (0.000301s)
teardown
============
Vows Results
============
A
B
Error in topic:
integer division or modulo by zero
Traceback (most recent call last):
File "/python/site-packages/pyvows/runner/gevent.py", line 104, in _run_setup_and_topic
topic = topic_func(*topic_list)
File "/testerror.py", line 13, in topic
return 42 / 0
ZeroDivisionError: integer division or modulo by zero
Nested tests following this error have not been run.
✗ OK » 1 honored • 1 broken (0.000342s)
from pyvows import Vows
@Vows.batch
class a(Vows.Context):
def topic(self):
return 'a'
def teardown(self):
print 'teardown'
class b(Vows.Context):
def topic(self):
return 42 / 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment