classification
Title: Various test failures if PYTHONUSERBASE is not canonicalized
Type: behavior Stage: patch review
Components: Tests Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: akshaysharma096, jdemeyer, ned.deily, nitishch
Priority: normal Keywords: easy, patch

Created on 2018-04-04 14:00 by jdemeyer, last changed 2018-04-09 17:21 by akshaysharma.

Pull Requests
URL Status Linked Edit
PR 6434 open akshaysharma, 2018-04-09 17:21
Messages (3)
msg314931 - (view) Author: Jeroen Demeyer (jdemeyer) * Date: 2018-04-04 14:00
Setting PYTHONUSERBASE=/tmp/x/.. causes the Python test suite to fail:

======================================================================
FAIL: test_user_similar (test.test_sysconfig.TestSysConfig)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/sage-config/local/src/cpython/Lib/test/test_sysconfig.py", line 276, in test_user_similar
    self.assertEqual(user_path, global_path.replace(base, user, 1))
AssertionError: '/tmp/lib/python3.8' != '/tmp/x/../lib/python3.8'
- /tmp/lib/python3.8
+ /tmp/x/../lib/python3.8
?     +++++

======================================================================
FAIL: test_get_path (test.test_site.HelperFunctionsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/sage-config/local/src/cpython/Lib/test/test_site.py", line 192, in test_get_path
    sysconfig.get_path('purelib', scheme))
AssertionError: '/tmp/x/../lib/python3.8/site-packages' != '/tmp/lib/python3.8/site-packages'
- /tmp/x/../lib/python3.8/site-packages
?     -----
+ /tmp/lib/python3.8/site-packages


======================================================================
FAIL: test_s_option (test.test_site.HelperFunctionsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/src/sage-config/local/src/cpython/Lib/test/test_site.py", line 199, in test_s_option
    self.assertIn(usersite, sys.path)
AssertionError: '/tmp/x/../lib/python3.8/site-packages' not found in ['/usr/local/src/sage-config/local/src/cpython', '/usr/local/src/sage-config/local/lib/python38.zip', '/usr/local/src/sage-config/local/src/cpython/Lib', '/usr/local/src/sage-config/local/src/cpython/build/lib.linux-x86_64-3.8', '/usr/local/src/sage-config/local/lib/python3.8/site-packages']
msg315088 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-04-08 18:16
Would you care to provide a PR fix with a test?
msg315135 - (view) Author: Akshay Sharma (akshaysharma096) * Date: 2018-04-09 16:25
What are the possible cases we can have here ?
History
Date User Action Args
2018-04-09 17:21:40akshaysharmasetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request6130
2018-04-09 16:25:53akshaysharma096setnosy: + akshaysharma096
messages: + msg315135
2018-04-08 18:16:23ned.deilysetnosy: + ned.deily
messages: + msg315088

keywords: + easy
stage: needs patch
2018-04-05 07:22:29nitishchsetnosy: + nitishch
2018-04-04 14:00:04jdemeyercreate