File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class InstalledShellTest(unittest.TestCase):
2828 def setUp (self ):
2929 self .temp = tempfile .TemporaryDirectory ()
3030 self .addCleanup (self .temp .cleanup )
31- self .root = Path (self .temp .name )
31+ self .root = Path (self .temp .name ). resolve ()
3232 self .selected = self .root / 'MSYS tools'
3333 self .selected .mkdir ()
3434 self .bash = self .selected / ('bash.exe' if os .name == 'nt' else 'bash' )
@@ -96,9 +96,17 @@ def test_windows_missing_path_bash_fails_before_launching_competing_shell(self):
9696
9797@unittest .skipIf (os .name == 'nt' , 'ps observation uses POSIX process groups; Windows exercises native jobs' )
9898class InstalledShellPSTest (InstalledShellTest ):
99- """Replay the shell contracts through real ps observation on POSIX hosts ."""
99+ """Replay shell contracts with a temporary path alias and real ps observation ."""
100100 def setUp (self ):
101- super ().setUp ()
101+ outer = tempfile .TemporaryDirectory ()
102+ self .addCleanup (outer .cleanup )
103+ root = Path (outer .name ).resolve ()
104+ real = root / 'real'
105+ real .mkdir ()
106+ alias = root / 'alias'
107+ alias .symlink_to (real , target_is_directory = True )
108+ with patch .object (tempfile , 'tempdir' , str (alias )):
109+ super ().setUp ()
102110 observation = patch .object (commands .sys , 'platform' , 'darwin' )
103111 observation .start ()
104112 self .addCleanup (observation .stop )
You can’t perform that action at this time.
0 commit comments