New submission from Garrett Cooper <yaneg...@gmail.com>:

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'
<assert fails>
`Calling teardown_module'

2. Removing assert False from setup_module...

`Calling setup_module'
- `Calling function_setup'
<assert fails>
- `Calling function_teardown'
- `Calling TestClass:setUp'
<assert fails>
- `Calling TestClass:tearDown'
`Calling teardown_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.

----------
components: Tests
files: issue-blah-2.4.5.diff
keywords: patch
messages: 83983
nosy: yaneurabeya
severity: normal
status: open
title: tearDown in unittest should be executed regardless of result in setUp
versions: Python 2.4, Python 2.5, Python 2.6
Added file: http://bugs.python.org/file13397/issue-blah-2.4.5.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5538>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to