Skip to content

Commit

Permalink
test: fix test_tree_with_broken_symlinks on Python 3.13
Browse files Browse the repository at this point in the history
https://docs.python.org/3/library/pathlib.html#pathlib.Path.resolve
says:

  _Changed in version 3.13:_ Symlink loops are treated like other
  errors: `OSError` is raised in strict mode, and no exception is raised
  in non-strict mode. In previous versions, `RuntimeError` is raised no
  matter the value of _strict_.

Adjust a test to take account of this.
  • Loading branch information
cjwatson committed Dec 16, 2024
1 parent 39a9d83 commit 6259f1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datalad_next/commands/tests/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ def test_tree_with_broken_symlinks(self, tmp_path, include_files):
link_to_self.symlink_to(link_to_self)
with assert_raises((RuntimeError, OSError)): # OSError on Windows
# resolution should fail because of infinite loop
link_to_self.resolve()
link_to_self.resolve(strict=True)

# 3. good symlink pointing to existing directory
link_to_dir1 = tmp_path / 'links' / '3_link_to_dir1'
Expand Down

0 comments on commit 6259f1c

Please sign in to comment.