-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
internal error when parametrising using yield functools.partial #740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Original comment by Roman Levin (BitBucket: romanlevin, GitHub: romanlevin): Seems to be caused by test failure passing the
|
|
Thanks @yaccz, here's a full example failure to the underlying problem: import functools
def do_it(x):
assert x == 2
test_foo = functools.partial(do_it, x=1)
|
@dimaqq, as an workaround, you can use @pytest.mark.parametrized to write equivalent code: @pytest.mark.parametrized('foo', range(10))
def test_one(foo=123):
tmp = secret.secretObject()
tmp.init(...) In which case you don't even need a I think @hpk42 has mentioned to discourage "yield based tests" in the docs, and IMHO the parametrized version is clearer anyway. 😄 |
Opened a new issue with a more specific report of the underlying problem. Thanks @dimaqq for reporting the issue. 😄 |
I created a PR which fixes this, feedback is welcome. |
Originally reported by: Dima Tisnek (BitBucket: dimaqq, GitHub: dimaqq)
Traceback is far below.
Unfortunately I cannot yet create a minimum reproducible example, because everything works, if I remove propitiatory code.
Note that all tests pass (I can remove all asserts even), but there's still an internal error.
Below is the outline of the test:
The text was updated successfully, but these errors were encountered: