You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# TODO: figure out why this fails in CI but not local
print(f"- {path} (directory)")
ifnested:
display_contents_of_all_files_in_folder(path, nested)
defassert_dir_trees_are_equal(dir1: Union[str, Path], dir2: Union[str, Path]):
""" Compare two directories recursively. Files in each directory are assumed to be equal if their names and contents are equal. See: https://stackoverflow.com/a/6681395/6276321 @param dir1: First directory path @param dir2: Second directory path @return: True if the directory trees are the same and there were no errors while accessing the directories or files, False otherwise. """dirs_cmp=filecmp.dircmp(dir1, dir2)
if (
len(dirs_cmp.left_only) >0orlen(dirs_cmp.right_only) >0orlen(dirs_cmp.funny_files) >0
):
pass# TODO: figure out why this fails in CI but not local# raise AssertionError(# f"lefy only: {dirs_cmp.left_only}. right only: {dirs_cmp.right_only}. funny files: {dirs_cmp.funny_files}"# )
(_, mismatch, errors) =filecmp.cmpfiles(
dir1, dir2, dirs_cmp.common_files, shallow=False
)
iflen(mismatch) >0orlen(errors) >0:
raiseAssertionError(f"mismatch: {mismatch}. errors: {errors}")
forcommon_dirindirs_cmp.common_dirs:
new_dir1=os.path.join(dir1, common_dir)
new_dir2=os.path.join(dir2, common_dir)
assert_dir_trees_are_equal(new_dir1, new_dir2)
dafb247b3c09c4770ffd58ff909cfacf81006d6a
The text was updated successfully, but these errors were encountered:
figure out why this fails in CI but not local
f"lefy only: {dirs_cmp.left_only}. right only: {dirs_cmp.right_only}. funny files: {dirs_cmp.funny_files}"
)
flexlate/tests/dirutils.py
Line 59 in 82f5af7
dafb247b3c09c4770ffd58ff909cfacf81006d6a
The text was updated successfully, but these errors were encountered: