/ pytest Public
Error using parametrize with default arguments #3221
status: help wanted
developers would like help from experts on this topic
related to @pytest.mark.parametrize
problem that needs to be addressed
general question, might be closed after 2 weeks of inactivity
With pytest 3.4.0:
You get the error:
It seems pytest is separating the concept of normal python arguments and 'fixtures' here, only classifying only default-free arguments as potential fixtures - and then only considering 'fixtures' as valid targets for parametrisation - but the error message completely obfuscates this: by any regular python interpretation the function definitely has an argument 'something'.
The documentation on this - https://docs.pytest.org/en/latest/parametrize.html doesn't show this as an example but also doesn't mention that it's a constraint; it's only through reading the pytest source that I could work out what the problem was.
Related: The wording of this was changed to 'argument' from 'fixture' in #1539 which makes sense in the context of that error, but only confuses this one.
The text was updated successfully, but these errors were encountered: