nose-devs/nose — Issue #70: package fixtures executed regardles of tag specification
Author: jpellerin
Created: 2011-12-14 15:57:53+00:00
State: open

Hi There,
I am hoping to avoid execution of fixtures on a package level when only
running tests based on tags which do not reside in that package.

What steps will reproduce the problem?
1. Create two packages tests.blackbox and tests.whitebox
2. Create two fixtures for package blackbox by creating a file __init__.py
and adding setup() and teardown() methods, and putting this in the
tests/blackbox directory.
3. Create two test files, with test functions: tests/whitebox/test_w.py and
other test/blackbox.test_b.py, each containing a test function called
test_me().
4. Tag testst.whitebox.test_w.test_me() with attribute "white",
tests.blackbox.test_b.test_me() with attribute "black".
5. Run: nose.run() -a tags=white

What is the expected output? What do you see instead?

You would expect that tests_w.test_me() would be executed. However, what
actually happens is package setup function for tests/blackbox is executed,
then test_w.test_me() is executed, then tests/blackbox teardown is executed.

What version of the product are you using? On what operating system?

nose version: 0.10.0a2
OS: CentOS release 5

It seems like fixtures defined in __init__.py files are executed regardless
of tags given. Any guidance on how to avoid this?

Thank you!

Google Code Info:
Issue #: 79
Author: denalini...@gmail.com
Created On: 2007-08-15T19:52:37.000Z
Closed On: