Fix test that leaks a chdir'd cwd across the test run (#17)
test_relative_symlink_to_common_file changed the process working directory via os.chdir() but never restored it, leaving subsequent tests running from a tmp_path fixture directory that gets deleted after the test. Restore cwd in a finally block, matching the pattern already used in test_pseudo_direntry.py. Also checks off the now-satisfied xfail-marker item: no xfail markers remain in the repo. Co-authored-by: Maxim Shulga <maxim.shulga@alludo.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2 files changed
+8
-4
No files matched your search
+2
-2
@@ -158,11 +158,11 @@ Acceptance criteria:
|
|||||||
- [x] Run CI on pull requests as well as pushes.
|
- [x] Run CI on pull requests as well as pushes.
|
||||||
- [x] Add macOS CI because macOS is an advertised platform.
|
- [x] Add macOS CI because macOS is an advertised platform.
|
||||||
- [x] Fix the Unix-socket path test that currently fails on a local macOS run.
|
- [x] Fix the Unix-socket path test that currently fails on a local macOS run.
|
||||||
- [ ] Replace nonexistent issue references in `xfail` markers with real tracked
|
- [x] Replace nonexistent issue references in `xfail` markers with real tracked
|
||||||
work, then remove the markers as fixes land.
|
work, then remove the markers as fixes land.
|
||||||
- [ ] Add subprocess-based concurrency, signal, interruption, and fault tests.
|
- [ ] Add subprocess-based concurrency, signal, interruption, and fault tests.
|
||||||
- [ ] Add filesystem-boundary and build/install smoke tests.
|
- [ ] Add filesystem-boundary and build/install smoke tests.
|
||||||
- [ ] Fix tests that change global state or assert against the wrong path.
|
- [x] Fix tests that change global state or assert against the wrong path.
|
||||||
|
|
||||||
Acceptance criteria:
|
Acceptance criteria:
|
||||||
|
|
||||||
|
|||||||
+6
-2
@@ -48,8 +48,12 @@ class TestHardlinkDir:
|
|||||||
src_dir, dst_dir = hardlink_dirs
|
src_dir, dst_dir = hardlink_dirs
|
||||||
cf_relpath = relpath(create_file(src_dir), src_dir, dst_dir)
|
cf_relpath = relpath(create_file(src_dir), src_dir, dst_dir)
|
||||||
sl2cf_relpath = "symlink_to_common_file"
|
sl2cf_relpath = "symlink_to_common_file"
|
||||||
os.chdir(src_dir)
|
original_cwd = os.getcwd()
|
||||||
os.symlink(cf_relpath, sl2cf_relpath)
|
try:
|
||||||
|
os.chdir(src_dir)
|
||||||
|
os.symlink(cf_relpath, sl2cf_relpath)
|
||||||
|
finally:
|
||||||
|
os.chdir(original_cwd)
|
||||||
|
|
||||||
fs.hardlink_dir(src_dir, dst_dir)
|
fs.hardlink_dir(src_dir, dst_dir)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user