-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
InternalError: AttributeError: 'str' object has no attribute 'relto' #1133
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
Comments
FWIW I see the same when I do |
I found a workaround: If I My guess is that when running the tests inside the @property
def path(self):
""" return a path object pointing to source code (note that it
might not point to an actually existing file). """
p = py.path.local(self.raw.co_filename)
# maybe don't try this checking
if not p.check():
# XXX maybe try harder like the weird logic
# in the standard lib [linecache.updatecache] does?
p = self.raw.co_filename
return p Perhaps it loaded the code from It seems to me that |
It seems that inside the tox environment `entry.path` points to the local "pytestqt/logging.py" file (importable from $CWD). Changing the current directory to "tests" during the tox run worksaround this problem.
It seems there are other situations where
Entry.path
might return strings rather thanpy.path.local
objects than just generated code. This is happening on pytest-qt AppVeyor on Python 2.7. 👻I have modified my local code to print
entry.path
:And this is what I see:
Not sure how to reproduce it, but anyway it seems to me we should take in account that
entry.path
might not be apy.path.local
object. This fixes my test suite:@RonnyPfannschmidt @hpk42 any ideas?
The text was updated successfully, but these errors were encountered: