Skip to content

nose's .setUp() and .tearDown() are not supported #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pytestbot opened this issue Nov 1, 2013 · 2 comments
Closed

nose's .setUp() and .tearDown() are not supported #377

pytestbot opened this issue Nov 1, 2013 · 2 comments
Labels
type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Floris Bruynooghe (BitBucket: flub, GitHub: flub)


py.test claims to support nose's class level setup and teardown. However nose will execute the .setUp() and .tearDown() methods of a class for each test function even when the class is not a unitest.TestCase subclass. py.test OTOH does not seem to do this.

It's probably not so hard to do this but before diving into it I was wondering if this even is something py.test wants to support as it can have backwards incompatibility issues. So maybe the right answer is to simply document the limitation/incompatibility?


@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


What backward compat issues do you see? If someone defines a setUp/tearDown in a non-unittest-deriving test class i guess she would expect them to run.

That being said, i slightly dislike "polluting" the non-unittest test class with redundant setup/teardown methods. It probably would also affect setUpClass, right?

however, i consider providing nose compatibility out of the box a possibly trumping goal. What do you think?

@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


fix issue377 by clarifying in the nose-compat docs that pytest
does not duplicate the unittest-API into the "plain" namespace.

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant