Skip to content

Commit

Permalink
Add changelog item and test for matthew-brett#216
Browse files Browse the repository at this point in the history
  • Loading branch information
HexDecimal committed Jun 7, 2024
1 parent 1af49a8 commit 5f9b205
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ rules on making a good Changelog.
version to `delocate==0.11.0`.
[#215](https://github.com/matthew-brett/delocate/pull/215)

### Fixed

- Existing libraries causing DelocationError were not shown due to bad string
formatting.
[#216](https://github.com/matthew-brett/delocate/pull/216)

## [0.11.0] - 2024-03-22

### Added
Expand Down
11 changes: 8 additions & 3 deletions delocate/tests/test_delocating.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_delocate_tree_libs(
sys_lib = EXT_LIBS[0]
lib_dict = without_system_libs(tree_libs_func(subtree))
lib_dict.update({"/unlikely/libname.dylib": {}})
with pytest.raises(DelocationError):
with pytest.raises(DelocationError, match=r"0000"):
delocate_tree_libs(lib_dict, copy_dir, subtree)

lib_dict = without_system_libs(tree_libs_func(subtree))
Expand Down Expand Up @@ -171,7 +171,9 @@ def test_delocate_tree_libs(
# out-of-tree will raise an error because of duplicate library names
# (libc and slibc both named <something>/libc.dylib)
lib_dict2 = without_system_libs(tree_libs_func(subtree2))
with pytest.raises(DelocationError):
with pytest.raises(
DelocationError, match=r".*liba.dylib .*already exists.*liba.dylib"
):
delocate_tree_libs(lib_dict2, copy_dir2, "/fictional")
# Rename a library to make this work
new_slibc = pjoin(dirname(slibc), "libc2.dylib")
Expand Down Expand Up @@ -365,7 +367,10 @@ def filt_func(libname: Text) -> bool:
shutil.copy2(libb, "subtree")
# If liba is already present, barf
shutil.copy2(liba, "subtree")
assert_raises(DelocationError, copy_recurse, "subtree", filt_func)
with pytest.raises(
DelocationError, match=r".*liba.dylib .*already exists"
):
copy_recurse("subtree", filt_func)
# Works if liba not present
os.unlink(pjoin("subtree", "liba.dylib"))
copy_recurse("subtree", filt_func)
Expand Down

0 comments on commit 5f9b205

Please sign in to comment.