-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Question/enhancement: (optionally) report failure if parametrize produces no arguments #3849
Copy link
Copy link
Closed
Labels
topic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstopic: tracebacksrelated to displaying and handling of tracebacksrelated to displaying and handling of tracebackstype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: feature-branchnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch
Metadata
Metadata
Assignees
Labels
topic: reportingrelated to terminal output and user-facing messages and errorsrelated to terminal output and user-facing messages and errorstopic: tracebacksrelated to displaying and handling of tracebacksrelated to displaying and handling of tracebackstype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branchtype: feature-branchnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch
Type
Fields
Give feedbackNo fields configured for issues without a type.
I noticed a potentially dangerous behaviour of parametrized tests. I have a parametrized test where arguments have to be filled in some "complicated" fashion, let's say via a call to
_get_arguments():It may happen that
_get_arguments()returns an empty list. In this case, the test is skipped. However, it may be better sometimes to mark the test asfailedorerroredin this case. Google suggests this is not currently possible viapytest, is this correct? Clearly, checks can be put elsewhere, but I think it would be useful, and less error prone, to be able to say something likenoskipvia another mark, or via an option ofparametrize.Thanks for the good work!