Thu Oct 12 14:28:14 2006

Ticket #98 (Closed: worksforme)

@with_setup not calling teardown() if test raises exception


Priority: normal Reporter: support-forums4@farmdev.com
Severity: normal Assigned to: jpellerin
Component: nose Status: closed
Version: 0.9.1 Resolution: worksforme
Milestone: 0.9.1 Keywords:  

Description by support-forums4@farmdev.com:

I'm not sure if this is desired behvior or not, but I noticed that if a test function decorated with @with_setup() raises an exception then the teardown() method is not called. My personal choice is that a teardown function is called in a finally block as the test is run, to *always* undo what was done by setup.

I took a [very] quick stab at adding a test to nose's suite for this but couldn't come up with one since setup and teardown are just properties set on the test method. hmm. Was using revision 98.

-Kumar McMillan?

Changelog

Sun Oct 22 11:23:45 2006: Modified by jpellerin

  • milestone set to 0.9.1
  • status changed from new to assigned

Sun Oct 22 14:18:44 2006: Modified by jpellerin

  • resolution set to worksforme
  • status changed from assigned to closed

I haven't been able to reproduce this. I added a test in [108] that seems to show the correct behavior, unless I'm not understanding the issue. I'm going to close this as works for me, but you can reopen it if you can show me how to reproduce the problem.