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
if TESTFN == "/tmp/@test", some tests fail #48090
Comments
test_urllib's test_geturl fails with following messege. test_urllib
test test_urllib failed -- Traceback (most recent call last):
File "/home/WhiteRabbit/python-dev/trunk/Lib/test/test_urllib.py",
line 84, in
test_geturl
self.assertEqual(self.returned_obj.geturl(), self.pathname)
AssertionError: 'file:///tmp/@test' != '/tmp/@test' test_support.TESTFN is /tmp/@test on cygwin, and Lib/urllib.py(484,485) if file[:1] == '/':
urlfile = 'file://' + file If this is geturl()'s design, probably test should be changed like |
I cannot create patch now, but test_site error comes from same reason.
After I applied following adhok patch, test passed. Index: Lib/test/test_site.py - def __init__(self, filename_base=TESTFN, imported="time",
+ def __init__(self, filename_base="@test", imported="time",
good_dirname="__testdir__", bad_dirname="__bad"):
"""Initialize instance variables"""
self.filename = filename_base + ".pth" site.py's addpackage() is doing fullname = os.path.join(sitedir, name) and on my cygwin, this equals to os.path.join(
"/home/WhiteRabbit/python-dev/trunk/lib/test",
"/tmp/@test.pth") #=> "/tmp/@test.pth" probably this is not good. (I cannot figure out what site.py is doing |
Same happend in test_import.py too.
Several tests seem to assume TESTFN is relative path (filename?), so |
To clarify Colin's comment (we worked on this at the sprints), in 2.7 and later regrtest no longer will generate a TESTFN that starts with /tmp in any circumstance, so that includes cygwin. (Instead regrtest creates a temporary directory in which the tests are run.) So, indeed, this bug is now out of date. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: