Skip to content

Test functions with decorators are collected in wrong order #129

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 Mar 21, 2012 · 2 comments
Closed

Test functions with decorators are collected in wrong order #129

pytestbot opened this issue Mar 21, 2012 · 2 comments
Labels
type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Felix Dreissig (noris network AG) (BitBucket: fdreissig, GitHub: fdreissig)


If a Python decorator is used with a 'test_*' function, py.test collects the testcases in the wrong order. This leads to strange behaviour if your expectation is that py.test always runs tests in the order the appear in the file.

From my expectations, decorated functions are put behind others in the test excecution order.


@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


if your decorator hides the original position, then you broke the discover-ability

it would be helpful to know what the decorator actually does

@pytestbot
Copy link
Contributor Author

Original comment by Felix Dreissig (noris network AG) (BitBucket: fdreissig, GitHub: fdreissig):


The affected deocrator came from [[http://www.voidspace.org.uk/python/mock/|Mock.py]], but that one tourned out to be an outdated version. I've been able to resolve the issue by upgrading Mock.

Therefore marking this as invalid now; sorry for the disruption but thanks for pointing me into the right direction!

@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