-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Nesting structure of parametrized classes #3438
Comments
thats a pycharm issue, pytest itself has separate items per parameterset, and no distinction on thise levels |
@RonnyPfannschmidt, both have separate items for each parametrized value of each test and my point in regards to pytest is exactly the lack of layering. I understand that PyCharm could do whatever it wants with the data but it seemed like pytest could be applying a bit more structure to the test nodes which would group the parametrization. It seemed a generally useful feature across various reporting mechanisms so I thought it might be helpful to have some piece of the feature implemented in pytest. (from
Without knowing much of anything about the pytest node structure I vaguely imagine something like this.
|
currently grouping by parameterization is not done as part of the collection tree at all the item list is reordered in a way where setup/teardown is minimized wrt scopes, as such its not possible to correctly map this into a tree directly |
(pytest sees a list of tests when doing the running, there is no structure at that level) |
@RonnyPfannschmidt, thanks for the explanation. I see how the intent I want needs to be handled independently. Also, I need to review ways to control test ordering. The purpose of my class is to group a sequence of test functions so that I can get a separate result for each step. They presently run in order but it sounds like that's fragile. Cheers, |
I have a parametrized class in pytest. I would like the results to be grouped in PyCharm (and maybe for other reports, hopefully this isn't PyCharm specific) by the parametrization values.
Instead I get the methods repeated with the values inside them.
It seemed like perhaps I could do something with
pytest_pycollect_makeitem()
but I haven't figured it out yet. It also seems like this might be preferred default behavior. Potentially it might even make sense with multiple parametrization to nest them.etc...
Thanks for any pointers on how to achieve this or consideration of this as a feature.
https://repl.it/@altendky/pytest-breaking-down-assertions-as-results-2
main.py
test_mine.py
The text was updated successfully, but these errors were encountered: