Skip to content

Commit b19e6a0

Browse files
committed
Tidy up test code slightly
1 parent 5dd9af2 commit b19e6a0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Lib/test/test_pathlib.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,17 +3013,16 @@ def test_absolute(self):
30133013
self.assertEqual(str(P(drive + 'foo').absolute()), os.path.join(BASE, 'foo'))
30143014

30153015
with os_helper.subst_drive(BASE) as other_drive:
3016+
# Set the working directory on the substitute drive
3017+
saved_cwd = os.getcwd()
30163018
other_cwd = f'{other_drive}\\dirA'
3017-
# set the working directory on the substitute drive
3018-
saved_dir = os.getcwd()
30193019
os.chdir(other_cwd)
3020-
os.chdir(saved_dir)
3020+
os.chdir(saved_cwd)
30213021

30223022
# Relative path on another drive
30233023
self.assertEqual(str(P(other_drive).absolute()), other_cwd)
30243024
self.assertEqual(str(P(other_drive + 'foo').absolute()), other_cwd + '\\foo')
30253025

3026-
30273026
def test_glob(self):
30283027
P = self.cls
30293028
p = P(BASE)

0 commit comments

Comments
 (0)