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

Improve error message when it is not possible to determine a function's signature #4196

Merged

Conversation

nicoddemus
Copy link
Member

This is an improvement as it at least indicates which is the problematic function:

============================================= ERRORS ==============================================
__________________________________ ERROR collecting test-foo.py ___________________________________
Could not determine arguments of <bound method TestCase.fix of <test-foo.TestCase object at 0x000001A6AA687908>>: invalid method signature
!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================== 1 error in 0.10 seconds =====================================

Fix #4026

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@nicoddemus
Copy link
Member Author

damn dude, I was just thinking about this. It's crazy that your commit is within minutes of me trying to track this issue down again. props

🤣

I just wanted to relax a bit and decided to fix some old issues, and this one appeared on my search. What a coincidence! 😁

@codecov
Copy link

codecov bot commented Oct 19, 2018

Codecov Report

Merging #4196 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4196      +/-   ##
==========================================
+ Coverage   95.81%   95.83%   +0.01%     
==========================================
  Files         109      109              
  Lines       24231    24343     +112     
  Branches     2389     2416      +27     
==========================================
+ Hits        23216    23328     +112     
+ Misses        720      719       -1     
- Partials      295      296       +1
Flag Coverage Δ
#docs 28.51% <33.33%> (+0.02%) ⬆️
#doctesting 28.51% <33.33%> (+0.02%) ⬆️
#linting 28.51% <33.33%> (+0.02%) ⬆️
#linux 95.61% <100%> (+0.02%) ⬆️
#nobyte 91.87% <100%> (ø) ⬆️
#numpy 92.91% <100%> (ø) ⬆️
#pexpect 41.28% <33.33%> (-0.04%) ⬇️
#py27 93.96% <100%> (+0.03%) ⬆️
#py34 92.28% <100%> (+0.01%) ⬆️
#py35 92.24% <100%> (-0.04%) ⬇️
#py36 93.95% <100%> (+0.01%) ⬆️
#py37 92.27% <100%> (-0.04%) ⬇️
#trial 92.91% <100%> (ø) ⬆️
#windows 94.05% <100%> (+0.01%) ⬆️
#xdist 93.78% <100%> (ø) ⬆️
Impacted Files Coverage Δ
src/_pytest/compat.py 96.62% <100%> (+0.07%) ⬆️
testing/test_collection.py 99.76% <100%> (ø) ⬆️
src/_pytest/recwarn.py 97.6% <0%> (-0.5%) ⬇️
testing/test_recwarn.py 100% <0%> (+0.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4871f7...ac57042. Read the comment docs.

@asottile asottile merged commit dc0b4ef into pytest-dev:master Oct 19, 2018
@nicoddemus nicoddemus deleted the better-signature-error-msg-4026 branch October 20, 2018 13:10
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

Successfully merging this pull request may close these issues.

Invalid signature in class fixture causes difficult-to-debug error
2 participants