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

setup functions call order #53

Closed
pytestbot opened this issue Jun 19, 2011 · 2 comments
Closed

setup functions call order #53

pytestbot opened this issue Jun 19, 2011 · 2 comments
Labels
type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: BitBucket: anomt, GitHub: anomt


Seems to me that when running py.test on test classes, for example:

#!python
def setup_module():
 pass

class TestClass:
 def setup(self):
  pass
 def test_first(self):
  pass

the setup of TestClass will be called first (before setup_module), I looked at the code and I think the problem is in nose.py.
If I understand correctly, a multicall argument should be added to the pytest_runtest_setup and get executed at the start of the function.


@pytestbot
Copy link
Contributor Author

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


fix issue53: nose-style setup now called with the correct ordering

@pytestbot
Copy link
Contributor Author

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


you can install the fix with {{{
#!bash

pip install -i http://pypi.testrun.org pytest
}}}

would be cool if you can check that ordering is now all how you would expect it. Thanks for the precise report and suggestion, btw!

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
mgorny pushed a commit to mgorny/pytest that referenced this issue May 27, 2023
Fix pytest-dev#44 - don't try to bind a random port.
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