Skip to content

Commit cf09c2d

Browse files
committed
Make directory context manager more robust
The test failed on macOS runners previously, due to an unresolved symbolic link
1 parent 0e094fd commit cf09c2d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cli_test_helpers/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __enter__(self):
7474
self.__prev_dir = os.getcwd()
7575
super().__enter__()
7676
os.chdir(self.name)
77-
return self.name
77+
return os.getcwd()
7878

7979
def __exit__(self, exc_type, exc_value, traceback):
8080
"""Return to the original directory before execution."""

tests/test_decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_random_directory_context():
5656
with RandomDirectoryContext() as random_dir:
5757
new_dir = os.getcwd()
5858

59-
assert new_dir == random_dir, "Does't behave like TemporaryDirectory"
59+
assert new_dir == random_dir, "Doesn't behave like TemporaryDirectory"
6060
assert new_dir != before_dir, "Context not in a different file system location"
6161

6262
after_dir = os.getcwd()

0 commit comments

Comments
 (0)