Created
February 14, 2012 19:01
-
-
Save jedp/1829212 to your computer and use it in GitHub Desktop.
pyvows teardown not invoked unless all tests pass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyvows import Vows, expect | |
@Vows.batch | |
class IfATestFails(Vows.Context): | |
def topic(self): | |
return "oh noes!" | |
def setup(self): | |
print "test 1 setup: this will be printed" | |
def teardown(self): | |
print "test 2 teardown: this will not be printed - oh noes!" | |
def the_teardown_method_never_gets_called(self, topic): | |
expect(topic).to_equal(42) | |
@Vows.batch | |
class IfAllTestsPass(Vows.Context): | |
def topic(self): | |
return True | |
def setup(self): | |
print "test 2 setup: this will be printed" | |
def teardown(self): | |
print "test 2 teardown: this will be printed" | |
def the_teardown_method_gets_called(self, topic): | |
expect(topic).to_be_true() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment