mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Merged revisions 71984 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r71984 | walter.doerwald | 2009-04-26 22:51:44 +0200 (So, 26 Apr 2009) | 2 lines Use test.test_support.EnvironmentVarGuard where tests change environment vars. ........
This commit is contained in:
parent
4af362905c
commit
b525e18500
6 changed files with 36 additions and 64 deletions
|
@ -419,10 +419,9 @@ class PosixPathTest(unittest.TestCase):
|
|||
self.assert_(isinstance(posixpath.expanduser(b"~root/"), bytes))
|
||||
self.assert_(isinstance(posixpath.expanduser(b"~foo/"), bytes))
|
||||
|
||||
orig_home = os.environ['HOME']
|
||||
os.environ['HOME'] = '/'
|
||||
self.assertEqual(posixpath.expanduser("~"), "/")
|
||||
os.environ['HOME'] = orig_home
|
||||
with test_support.EnvironmentVarGuard() as env:
|
||||
env.set('HOME', '/')
|
||||
self.assertEqual(posixpath.expanduser("~"), "/")
|
||||
|
||||
self.assertRaises(TypeError, posixpath.expanduser)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue