Skip to content

setup functions call order #53

Closed
Closed

Description

@pytestbot

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.


Activity

  1. pytestbot commented on Jul 5, 2011

    @pytestbot
    ContributorAuthor

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


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

  2. pytestbot commented on Jul 5, 2011

    @pytestbot
    ContributorAuthor

    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!

  3. added a commit that references this issue on May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions