parametrized: ids: support generator/iterator#6174
parametrized: ids: support generator/iterator#6174blueyed merged 1 commit intopytest-dev:featuresfrom
Conversation
|
Fails on py35 only due to random order (easy to fix / ignore, but IIRC there was an issue for that already maybe?): (https://travis-ci.org/pytest-dev/pytest/jobs/611099976#L6281) |
|
For reference I'm planning to add |
b0d3ba6 to
7e59308
Compare
10179ce to
167d5fb
Compare
src/_pytest/python.py
Outdated
| else: | ||
| assert "ids" in kwargs | ||
| kwargs = kwargs.copy() | ||
| kwargs["ids"] = ids |
There was a problem hiding this comment.
Having ids either as arg or kwarg is also not nice here.
Could be combined with _has_param_ids though at least.
src/_pytest/python.py
Outdated
| ) | ||
| newcalls.append(newcallspec) | ||
| self._calls = newcalls | ||
| return ids |
There was a problem hiding this comment.
Not happy about having to return this here (for storing it in pytest_generate_tests then).
There was a problem hiding this comment.
Solving the wrong problem at the wrong place feels like that
There was a problem hiding this comment.
The main problem here is passing args and kwargs, but not the mark.
This could be done instead here also - but the function can be used by itself also (without a mark), so I wanted to keep it apart. But having an optional store_resolved_ids_on_mark kwarg might suffice then.
Returning the generated ids is not too bad also after all, but I've felt that it might be limiting in the future, and should therefore return the generated calls also etc.
| combines by appending args and merging the mappings | ||
| """ | ||
| assert self.name == other.name | ||
|
|
There was a problem hiding this comment.
we might want to add a comment that this is intended to be a temporary hack to be resolved with object based marks
There was a problem hiding this comment.
👍
Will revisit before merging.
Thanks for the approval - I'm glad we could figure out something in the end.
Fixes pytest-dev#759 - Adjust test_parametrized_ids_invalid_type, create list to convert tuples Ref: pytest-dev#1857 (comment) - Changelog for int to str conversion Ref: pytest-dev#1857 (comment)
Fixes #759
Via blueyed#105.