question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

compat::getfuncargnames removes self from instance method twice by mistake

See original GitHub issue
  • a detailed description of the bug or suggestion I have a pyfuncitem which is an instance method and its signature looks like this: def run_test(self, testbed_obj): <== This testbed_obj is a fixture When getfuncargnames got called to return the argnames, it removed this testbed_obj in line 168 of compat.py, which I think is wrong, because the parameter got from line 146 of compat.py has self removed from the signature.
  • output of pip list from the virtual environment you are using Package Version Location

astroid 1.4.9 atomicwrites 1.3.0 attrs 19.3.0 automatos-tool-library 15 avro 1.9.1 backports.functools-lru-cache 1.6.1 backports.shutil-get-terminal-size 1.0.0 backports.ssl-match-hostname 3.7.0.1 bcrypt 3.1.7 certifi 2019.11.28 cffi 1.13.2 chardet 3.0.4 colorama 0.4.3 configparser 4.0.2 confluent-kafka 1.3.0 contextlib2 0.6.0.post1 coverage 5.0.3 cryptography 2.8 decorator 4.4.1 dicttoxml 1.7.4 docker-py 1.10.6 docker-pycreds 0.4.0 enum34 1.1.6 filelock 3.0.12 flake8 3.6.0 FormEncode 1.3.1 funcsigs 1.0.2 future 0.18.2 futures 3.3.0 gitdb2 2.0.6 GitPython 2.1.14 httpretty 0.9.7 idna 2.8 importlib-metadata 1.5.0 ipaddress 1.0.23 isort 4.3.21 lazy-object-proxy 1.4.3 logutils 0.3.5 mccabe 0.6.1 mock 3.0.5 more-itertools 5.0.0 ndg-httpsclient 0.5.1 packaging 20.1 paramiko 2.7.1 pathlib2 2.3.5 pip 20.0.2 pluggy 0.13.1 py 1.8.1 pyasn1 0.4.8 pybase64 0.5.0 pycodestyle 2.4.0 pycparser 2.19 pycyclone 0.9.277 pyflakes 2.0.0 pylint 1.6.4 PyNaCl 1.3.0 pyOpenSSL 19.1.0 pyparsing 2.4.6 pysftp 0.2.9 pytest 4.6.9 pytest-html 1.22.0 pytest-metadata 1.8.0 python-nmap 0.6.1 pytz 2019.3 pyvmomi 6.7.3 PyYAML 5.3 redis 2.10.6 requests 2.22.0 requests-mock 1.6.0 requests-toolbelt 0.9.1 retrying 1.3.3 scandir 1.10.0 setuptools 44.0.0 setuptools-scm 3.2.0 six 1.14.0 smmap2 2.0.5 spur 0.3.21 suds 0.4 toml 0.10.0 tox 3.14.3 urllib3 1.23 uuid 1.30 validators 0.11.3 virtualenv 16.7.9 waiting 1.4.1 walrus 0.3.5 wcwidth 0.1.8 websocket-client 0.57.0 wheel 0.34.2 wrapt 1.11.2 xmltodict 0.12.0 zipp 1.1.0 We have some private Python packages that I don’t want to list here.

  • pytest and operating system versions pytest 4.6.9 Windows 10
  • minimal example if possible class MyTest(BaseTestCase): def run_test(self, testbed_obj):

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
RonnyPfannschmidtcommented, Feb 18, 2020

i apologize, after re-reading the original text i understood the issue is indeed abouta bound method on a own item,

we should support bound methods there and with signature and a type check we probably can do that correctly

0reactions
SeanXu1984commented, Feb 21, 2020

I suppose I should create PR against 4.6.x branch?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does doing self in a method definition twice not work?
When Python tries to evaluate that function it is going to try and load a name named self , look-up an attribute on...
Read more >
Reset method being called twice during instantiation of a class ...
I'm defining various classes with an inheritance hierarchy and having problems setting up each class's reset method so that it is only ...
Read more >
Defining Classes with Instances in Java
The Python version included self.diff to access the instance method diff. The Java compiler can see that diff is a Point method, and...
Read more >
How to use self in Python – explained with examples
This article helps you acquire knowledge on the self variable in Python and its ... What are Instance methods and Class methods in...
Read more >
Classes - Object-Oriented Programming in Python
self is a parameter passed into each instance method of the class – it will be replaced by the instance object when the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found