Collect functools.partial objects#813
Conversation
b731d53 to
3309c69
Compare
_pytest/python.py
Outdated
There was a problem hiding this comment.
i think you can just import functools or "partial".
|
Hum, I guess we can try to support functools.partial and besides, your PR does not look too hackish to me although it would be good if we could reduce redundancy (see my code comments). If it proves to burdensome to support functools.partials we either need to refactor or drop the feature so we probably shouldn't documented it as supported for now. |
|
since we consider it "unsupported" we should probably issue a warning as well |
Done. I thought it was a little hackish because we have to consider the partial arguments explicitly when extracting the fixture names from the function, but I guess that's OK.
If we decide to decline this PR for some reason, I agree a warning is appropriate, like we do today when a |
|
+1 |
d690780 to
bc9f7f4
Compare
|
Rebased on |
bc9f7f4 to
a7b4ed8
Compare
Fix for issue #811.
I feel the current implementation is hackish and might break in some corner-cases.
Perhaps it would be better to don't support tests created by
functools.partialobjects at all, and issue a warning during collection and add a note to the documentation?