Message 83983 - Python tracker (original) (raw)

While trying to deal with some annoying issues with setting up and tearing down consoles via pexpect, I noticed that the teardown functions / methods weren't being executed via nose.

After applying this change to 2.4.5 and 2.6.1, things work as expected (note: this patch only applies cleanly with 2.4.5 AFAICT -- it didn't work with 2.6.1).

My expectations are:

========

I'd expect that the best fix would be for tearDown to be unconditionally called if setUp is called, s.t. testers can ensure that the operating state of the UUT and testbed are at a predefined state.

So in my testcase provided, I would expect the following flow:

  1. Keeping assert False in setup_module... `Calling setup_module'

    `Calling teardown_module'
  2. Removing assert False from setup_module...

`Calling setup_module'

If this isn't done, it makes some operations, like tearing down consoles with pexpect extremely painful to perform...

========

Please see <http://code.google.com/p/python-nose/issues/detail?id=234> for more details.