You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was recently having a tough time tracking down an issue with my test set up. After a while of trying everything I could and reading the API reference, I started browsing the other pages of the GitHub site. Browsing through the Home page, I found a line of documentation that solved the issue I was having.
Problem
Currently, the line
However WARNING: only the case functions defined BEFORE the test function in the module file will be taken into account!
only appears under the Alternate source(s) section of Home. It would be nice to have some reference to this warning in the API reference page of the GitHub site; specifically, under the documentation for @parametrize_with_cases.
Code Suggestion
It could be a nice feature to display a warning when a function using @parametrize_with_cases(cases='THIS_MODULE') is skipped by Pytest due getting an "empty parameter set". However, I am not familiar with the inner workings of pytest-cases, so I have no clue as to how much effort something like this would take to implement.
The text was updated successfully, but these errors were encountered:
Thanks @ImplyingICheck for reporting this issue, and very sorry for the long delay in answering !
Indeed, the documentation is probably a bit light on this, would you like to propose a PR modifying the API reference page (and the corresponding code docstring) ?
Concerning your suggestion for a warning, it could be done just after this line:
# Collect all cases
cases_funs = get_all_cases(f, cases=cases, prefix=prefix, glob=glob, has_tag=has_tag, filter=filter)
# TODO if `cases_funs` is empty (and possibly on other conditions to limit the annoyance ?), construct a warning
However would it be correctly displayed by pytest ? Here again if you are interested feel free to propose a PR (it can be the same PR)
Thanks again for your feedback and interesting proposals !
Background
I was recently having a tough time tracking down an issue with my test set up. After a while of trying everything I could and reading the API reference, I started browsing the other pages of the GitHub site. Browsing through the
Home
page, I found a line of documentation that solved the issue I was having.Problem
Currently, the line
only appears under the
Alternate source(s)
section ofHome
. It would be nice to have some reference to this warning in theAPI reference
page of the GitHub site; specifically, under the documentation for@parametrize_with_cases
.Code Suggestion
It could be a nice feature to display a warning when a function using
@parametrize_with_cases(cases='THIS_MODULE')
is skipped by Pytest due getting an "empty parameter set". However, I am not familiar with the inner workings of pytest-cases, so I have no clue as to how much effort something like this would take to implement.The text was updated successfully, but these errors were encountered: