Skip to content
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

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

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

Comments

Projects
None yet
1 participant
@pytestbot
Copy link

commented Nov 1, 2013

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

This comment has been minimized.

Copy link
Author

commented Nov 1, 2013

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

This comment has been minimized.

Copy link
Author

commented Nov 22, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.