Skip to content

Commit d49fdf3

Browse files
committed
fixup! bpo-1154351: add get_current_dir_name() to os module
1 parent cc1735f commit d49fdf3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Lib/test/test_os.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,13 +1269,15 @@ def test_getcwd(self):
12691269
os.symlink(self.tmp_dir, self.tmp_lnk, True)
12701270
os.chdir(self.tmp_lnk)
12711271
if os.name == 'nt':
1272-
self.assertEqual(os.getcwd(), self.tmp_lnk)
1272+
# windows doesn't dereference the path
1273+
expected_cwd = self.tmp_lnk
12731274
else:
1274-
self.assertEqual(os.getcwd(), self.tmp_dir)
1275+
expected_cwd = self.tmp_dir
1276+
self.assertEqual(os.getcwd(), expected_cwd)
12751277
with mock.patch.dict('os.environ', {'PWD': self.tmp_dir}):
1276-
self.assertEqual(os.getcwd(), self.tmp_dir)
1278+
self.assertEqual(os.getcwd(), expected_cwd)
12771279
with mock.patch.dict('os.environ', {'PWD': self.tmp_lnk}):
1278-
self.assertEqual(os.getcwd(), self.tmp_dir)
1280+
self.assertEqual(os.getcwd(), expected_cwd)
12791281

12801282
def test_get_current_dir_name(self):
12811283
# os.get_current_dir_name() returns the direct path--mirroring

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy