File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1554,7 +1554,8 @@ def test_cwd(self):
15541554 def test_absolute_common (self ):
15551555 P = self .cls
15561556
1557- with os_helper .change_cwd (BASE ):
1557+ with mock .patch ("os.getcwd" ) as getcwd :
1558+ getcwd .return_value = BASE
15581559
15591560 # Simple relative paths.
15601561 self .assertEqual (str (P ().absolute ()), BASE )
@@ -2992,10 +2993,9 @@ def test_absolute(self):
29922993 self .assertEqual (str (P (share + 'a\\ b' ).absolute ()), share + 'a\\ b' )
29932994
29942995 # UNC relative paths.
2995- def getfullpathname ( path ) :
2996- return os . path . join ( share , path )
2996+ with mock . patch ( "os.getcwd" ) as getcwd :
2997+ getcwd . return_value = share
29972998
2998- with mock .patch ("nt._getfullpathname" , getfullpathname ):
29992999 self .assertEqual (str (P ().absolute ()), share )
30003000 self .assertEqual (str (P ('.' ).absolute ()), share )
30013001 self .assertEqual (str (P ('a' ).absolute ()), os .path .join (share , 'a' ))
You can’t perform that action at this time.
0 commit comments