parametrize_from_file icon indicating copy to clipboard operation
parametrize_from_file copied to clipboard

Pycharm: 'parametrize_from_file' is not callable

Open foxale opened this issue 2 years ago • 3 comments

PyCharm is not happy about something with the decorator and I'm not sure why image

foxale avatar Sep 08 '23 14:09 foxale

It's probably because making a module usable as a decorator is a bit of a hack. I don't have any experience with PyCharm, but my guess is that it's using a simple heuristic (like don't try to call modules) that happens to not work in this case. If the warning bothers you, and if there's no easy way to turn it off, you can always import the decorator directly:

import parametrize_from_file as pff

@pff.parametrize
def test_this_and_that():
    ...

kalekundert avatar Sep 08 '23 14:09 kalekundert

Well

image

foxale avatar Sep 09 '23 17:09 foxale

Looks like a PyCharm bug to me. It's getting confused because it's looking at the argument list for the undecorated version of a decorated function.

kalekundert avatar Sep 09 '23 20:09 kalekundert