pytest.mark.parametrize ids with empty parameter #13235
Labels
Content-Length: 245475 | pFad | http://redirect.github.com/pytest-dev/pytest/issues/13235
D5Fetched URL: http://redirect.github.com/pytest-dev/pytest/issues/13235
Alternative Proxies:
a detailed description of the bug or problem you are having, MWE
I have parametrized tests that take input data from a config, e.g., a list of matrices. It may happen that there is no input parameter at all, i.e., empty list of parameters, see below
Now, I'd like to just collect matrices there are, i.e.
pytest dev.py --collect-only
but it fails as it tries to create at least a single instance for
test_foo
. The reason is thatids
is a callable and it's called withNotSetType
.I found a nasty workaround
which returns
While the problem might seem a bit artificial, it's a scenario in my case. I have no control on what data are in the config, I just need to test the thing without failures. The workaround is doable but I would don't like writing these for each single case, and frankly, don't understand why
ids
are invoked at all.output of
pip list
from the virtual environment you are using20.04.1-Ubuntu
The text was updated successfully, but these errors were encountered: