From c39f7554eda8d56564d963ff771142ef32332f18 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sat, 8 Jun 2024 11:09:01 -0500 Subject: [PATCH] Handle Linux tests when the filesystem doesn't support extended attributes --- tests/test_cli.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 10e545f..72f513a 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -32,12 +32,16 @@ def image_with_exif_data(tmp_path): def image_with_metadata(image_with_exif_data): """Fixture for an image with metadata.""" if RUNNING_ON in ['Darwin', 'Linux']: - xattr(image_with_exif_data).set( - f'{getuser()}.test_extended_attribute' - if RUNNING_ON == 'Linux' - else 'com.apple.macl', - b'\x00', - ) + try: + xattr(image_with_exif_data).set( + f'{getuser()}.test_extended_attribute' + if RUNNING_ON == 'Linux' + else 'com.apple.macl', + b'\x00', + ) + except OSError: # pragma: nocover + # filesystem does not support extended attributes + pass return image_with_exif_data