This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kumar303
Recipients exarkun, kumar303, ngie, purcell, rhettinger
Date 2009-03-23.22:47:51
SpamBayes Score 8.1632965e-07
Marked as misclassified No
Message-id <1237848474.51.0.376190776039.issue5538@psf.upfronthosting.co.za>
In-reply-to
Content
For the record, I too have been plagued by failing setUp's :( and the
pattern you describe is not uncommon.  I was just pointing out that
changing the semantics of tearDown() will affect a lot of existing code.
 As with any backwards incompatible change the effort of porting to the
new functionality should be considered.  In this case my fear is that it
will be hard to know that tearDown() is not behaving how it used to
behave since an exception in tearDown() would be once removed from the
actual exception in setUp().

More directly addressing your problem, have you considered switching to
context managers?

Could maybe do something like:

with ConfiguredIOS():
    test_something()

the context manager could define __exit__() which would get called
unconditionally.  Also, these could be chained together as decorators to
sort-of do what it seems like you were trying to do in tearDown().
History
Date User Action Args
2009-03-23 22:47:55kumar303setrecipients: + kumar303, rhettinger, purcell, exarkun, ngie
2009-03-23 22:47:54kumar303setmessageid: <1237848474.51.0.376190776039.issue5538@psf.upfronthosting.co.za>
2009-03-23 22:47:53kumar303linkissue5538 messages
2009-03-23 22:47:51kumar303create