-
Notifications
You must be signed in to change notification settings - Fork 40
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
AUTO cases in conftest: AssertionError #309
Comments
Thanks @michele-riva ! Indeed I confirm
Would you like to propose a PR for these two mods ? |
Sure, I can draft one right away. |
michele-riva
added a commit
to michele-riva/python-pytest-cases
that referenced
this issue
Nov 20, 2023
Fixed by PR #320 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the great work! I just stumbled across a corner case.
Example to reproduce:
conftest.py
test_cases.py
test.py
Gives
Seems very reasonable to me to not allow
AUTO
use in aconftest.py
as it can be ambiguous which cases are to be used for parametrization. However, it probably would be nicer to explicitly check for this and raise a clearer exception? E.g., at the beginning ofpython-pytest-cases/src/pytest_cases/case_parametrizer_new.py
Line 650 in ab3b719
As a side note, I realized a possible inconsistency in the doc of the
@parametrize_with_cases
API: it looks like the "second alternative" for looking up cases inAUTO
mode iscases_<name>.py
(plural), and notcase_<name>.py
. Seepython-pytest-cases/src/pytest_cases/case_parametrizer_new.py
Line 671 in ab3b719
The text was updated successfully, but these errors were encountered: