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

adding hooks for controlling instances of tests #46

Closed
pytestbot opened this issue May 27, 2011 · 4 comments
Closed

adding hooks for controlling instances of tests #46

pytestbot opened this issue May 27, 2011 · 4 comments
Labels
type: enhancement new feature or API change, should be merged into features branch

Comments

@pytestbot
Copy link
Contributor

Originally reported by: BitBucket: ddandd, GitHub: ddandd


adding pytest_collect_instances(class_item), that will return the test instances of a test_class and each test on an instance will have the same instance object (self)
It should be used when writing long and complicated generated tests, it'll allow calling a setup_instance method that would be able to get funcargs, or calling the init (that will require to add a pytest_collect_can_initialize_class or a similar hook)


@pytestbot
Copy link
Contributor Author

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


you are outlining a very complex topic, which hard to get right,
specially with only a fuzzy outline of the process/use-cases

could you explain in more depth what your specific use-case is

@pytestbot
Copy link
Contributor Author

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


also think one or more examples of what you think should work, would help.

You can also describe the pure user-level experience you'd like to see and we discuss hooks/implementation separately.

@pytestbot
Copy link
Contributor Author

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


can this be closed?

@pytestbot
Copy link
Contributor Author

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


no more concrete details and examples, closing.

@pytestbot pytestbot added the type: enhancement new feature or API change, should be merged into features branch label Jun 15, 2015
fkohlgrueber pushed a commit to fkohlgrueber/pytest that referenced this issue Oct 27, 2018
mgorny pushed a commit to mgorny/pytest that referenced this issue May 27, 2023
mgorny pushed a commit to mgorny/pytest that referenced this issue May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

1 participant