-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fails collecting tests if test module level obj has __getattr__() #1035
Comments
Here is an issue pytest-dev/pytest#1035
This only happens for me on Python 2.6. Python 2.7 is unaffected. |
Thanks for the report! 😄 |
Since its only a proble!m on python 2.6 I'm considering leaving it be |
So pytest no longer supports Python 2.6? |
its still supported, but since python 2.6 is eol'd since years we should think about how much code and maintenance burdens we invest in it as volunteer work, in particular with libs that are somehow broken only on it @hpk42 whats your oppinion on that matter |
just discussed with @hpk42 on irc result: since we officially support it we should fix it |
FWIW, I can confirm what @alfredodeza said - https://travis-ci.org/jantman/awslimitchecker/builds/82210772 tests against 26, 27, 32, 33, 34, pypy and pypy3; only 2.6 breaks. |
at unit-test level all python packages seem to be required |
i finished a first attempt to solving it, resulting in the python interpreter oom-ing my machine, |
To avoid pytest-dev/pytest#1035 Signed-off-by: Travis Rhoden <trhoden@redhat.com>
To avoid pytest-dev/pytest#1035 Signed-off-by: Travis Rhoden <trhoden@redhat.com>
To avoid pytest-dev/pytest#1035 Signed-off-by: Travis Rhoden <trhoden@redhat.com>
to be clear, this started with 2.8.0, correct? |
Yes, it seems to work fine with 2.7.3 which is before that commit. |
The difference in Python versions seems to be with $ python2.7
Python 2.7.9 (default, Apr 2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from inspect import isclass
>>> from whatever import _
>>> isclass(_)
False which is the correct answer btw - $ python2.6
Python 2.6.9 (default, Apr 16 2015, 18:31:03)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from inspect import isclass
>>> from whatever import _
>>> isclass(_)
True My commit, mentioned above, amends the def pytest_pycollect_makeitem(collector, name, obj):
...
if isclass(obj):
if collector.istestclass(obj, name):
Class = collector._getcustomclass("Class")
outcome.force_result(Class(name, parent=collector)) See pytest_pycollect_makeitem. So I propose the priority fix, is for us to provide a fixed There's a second, and more questionable issue raised here. In my patch, I added support to respect nose's The good news is that if we fix the first issue, we're not forced to answer the second (in this ticket). |
Thanks for the investigation work @tomviner! It seems your solution of using a fixed |
The probably related CPython commit: https://hg.python.org/cpython/rev/35bf8f7a8edc?revcount=1920 |
Comments on this patch please #1121 |
@alfredodeza @jantman @Renstrom @Daikiri @jmoldow @trhoden any chance some of you could test that PR as well? 😉 |
PR #1121 works for me. Thank you all! |
Fixed in #1121 |
To avoid pytest-dev/pytest#1035 Signed-off-by: Travis Rhoden <trhoden@redhat.com>
To avoid pytest-dev/pytest#1035 Signed-off-by: Travis Rhoden <trhoden@redhat.com>
The issue is in this line. Object returns something arbitrary and then it's required to be int lineno.
Breaks this for example.
The text was updated successfully, but these errors were encountered: