From 25ac6ef0fcd7b4b1e479d94fa5a8d8c001fc904c Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 16 Dec 2024 23:48:21 +0000 Subject: [PATCH] test: fix test_tree_with_broken_symlinks on Python 3.13 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. --- datalad_next/commands/tests/test_tree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datalad_next/commands/tests/test_tree.py b/datalad_next/commands/tests/test_tree.py index 0b3b2158..262c858e 100644 --- a/datalad_next/commands/tests/test_tree.py +++ b/datalad_next/commands/tests/test_tree.py @@ -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'