summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ntpath.py
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2019-03-12 15:39:57 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2019-03-12 15:39:57 (GMT)
commit25ec4a45dcc36c8087f93bd1634b311613244fc6 (patch)
tree1e5e08a4ee2c9f1625ad980528285cd7b3d4d5fd /Lib/test/test_ntpath.py
parent410aea1ebf2f56364369be3b477763ce78577c07 (diff)
downloadcpython-25ec4a45dcc36c8087f93bd1634b311613244fc6.zip
cpython-25ec4a45dcc36c8087f93bd1634b311613244fc6.tar.gz
cpython-25ec4a45dcc36c8087f93bd1634b311613244fc6.tar.bz2
bpo-36264: Don't honor POSIX HOME in os.path.expanduser on Windows (GH-12282)
Diffstat (limited to 'Lib/test/test_ntpath.py')
-rw-r--r--Lib/test/test_ntpath.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index 223e50f..fc2398c 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -262,20 +262,21 @@ class TestNtpath(unittest.TestCase):
env['USERPROFILE'] = 'C:\\eric\\idle'
tester('ntpath.expanduser("~test")', 'C:\\eric\\test')
tester('ntpath.expanduser("~")', 'C:\\eric\\idle')
-
- env.clear()
- env['HOME'] = 'C:\\idle\\eric'
- tester('ntpath.expanduser("~test")', 'C:\\idle\\test')
- tester('ntpath.expanduser("~")', 'C:\\idle\\eric')
-
tester('ntpath.expanduser("~test\\foo\\bar")',
- 'C:\\idle\\test\\foo\\bar')
+ 'C:\\eric\\test\\foo\\bar')
tester('ntpath.expanduser("~test/foo/bar")',
- 'C:\\idle\\test/foo/bar')
+ 'C:\\eric\\test/foo/bar')
tester('ntpath.expanduser("~\\foo\\bar")',
- 'C:\\idle\\eric\\foo\\bar')
+ 'C:\\eric\\idle\\foo\\bar')
tester('ntpath.expanduser("~/foo/bar")',
- 'C:\\idle\\eric/foo/bar')
+ 'C:\\eric\\idle/foo/bar')
+
+ # bpo-36264: ignore `HOME` when set on windows
+ env.clear()
+ env['HOME'] = 'F:\\'
+ env['USERPROFILE'] = 'C:\\eric\\idle'
+ tester('ntpath.expanduser("~test")', 'C:\\eric\\test')
+ tester('ntpath.expanduser("~")', 'C:\\eric\\idle')
@unittest.skipUnless(nt, "abspath requires 'nt' module")
def test_abspath(self):