Skip to content

Test functions generated by functools.partial raise an internal error during collection #811

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

Closed
nicoddemus opened this issue Jul 2, 2015 · 1 comment
Labels
type: bug problem that needs to be addressed

Comments

@nicoddemus
Copy link
Member

As discussed in #740, the following test functions fail during collection:

import functools
def do_it(x):
    assert x == 2
test_foo = functools.partial(do_it, x=1)  
=================================== ERRORS ====================================
________________________ ERROR collecting test_foo.py _________________________
...\lib\inspect.py:752: in getargs
    raise TypeError('{!r} is not a code object'.format(co))
E   TypeError: <functools.partial object at 0x0000000003D37278> is not a code object
=============================== warning summary ===============================
WC2 X:\test_foo.py cannot collect 'test_foo' because it is not a function.
===================== 1 warnings, 1 error in 0.02 seconds =====================
@nicoddemus nicoddemus added the type: bug problem that needs to be addressed label Jul 2, 2015
nicoddemus added a commit to nicoddemus/pytest that referenced this issue Jul 3, 2015
nicoddemus added a commit to nicoddemus/pytest that referenced this issue Jul 3, 2015
nicoddemus added a commit to nicoddemus/pytest that referenced this issue Jul 13, 2015
nicoddemus added a commit to nicoddemus/pytest that referenced this issue Jul 16, 2015
@jan-matejka
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

2 participants