Skip to content
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

ValueError: 'int' is not callable when running pytest #12900

Closed
stur86 opened this issue Oct 18, 2024 · 3 comments
Closed

ValueError: 'int' is not callable when running pytest #12900

stur86 opened this issue Oct 18, 2024 · 3 comments

Comments

@stur86
Copy link

stur86 commented Oct 18, 2024

I am using pytest 8.3.3. in an Ubuntu 20.04 WSL system. When I try to run pytest, before even any test is loaded, I get a crash that looks like this:

File "/usr/lib/python3.10/argparse.py", line 1447, in add_argument
    raise ValueError('%r is not callable' % (type_func,))
ValueError: 'int' is not callable

Going back through the trace I find that it originates in _pytest/config/argparsing.py, specifically at line 131:

arggroup.add_argument(*n, **a)

Printing out the contents of n and a the line before, it crashes on:

['--element-number'] {'action': 'store', 'type': 'int', 'default': 20, 'help': 'defines how many elements will display in a result', 'dest': 'element_number'}

apparently because 'type' is a string rather than the function int. If I replace the value before, pytest works. Any clue what causes this?

@uglide
Copy link

uglide commented Oct 18, 2024

@stur86 I encountered the same problem in GitHub Actions. I'd appreciate any pointers on how to solve it.

GitHub Action uses Ubuntu 22. I debugged it with pdb and it crashes on the same line

@uglide
Copy link

uglide commented Oct 18, 2024

It's a bug in the pytest-profiling plugin man-group/pytest-plugins#242

@webknjaz
Copy link
Member

Sounds like this can be closed, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants