Parametrized nodeid not matching with parametrized IDs
See original GitHub issueThis is about this issue in pytest-repeat: https://github.com/pytest-dev/pytest-repeat/issues/21
It seems that the bug doesn’t come from the plugin: I managed to reproduce with a simple test here. It affects all pytest versions, at least since 2.8
I wrote a test and a fix attempt here: https://github.com/vbarbaresi/pytest/commit/12769f0d3bda3c53426ba124e89f0072cc0b320b
The issue is the following: with parametrized IDs and parametrized fixtures, one can’t run a test using its node ID with a [parameter] argument
I tracked it down to the x.name
vs name
matching, which is in my example:
test_foo[1-param]
vs test_foo[param]
My fix attempt drops everything after [
on both sides. However, we lose the supplied parameter value so it’s not satisfying. I don’t know where to fix this properly.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (7 by maintainers)
@blueyed i actually have a fix on the horizon, but it will at least need 3-4 major releases to sort nodes out - given that outline no more ranting needed
nothing new there, after the rest of the
path
refactoring lands i’m going to work on setting up the function-definition node, afterwards we can do it more easily