Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched test_cli to use to sys.executable #10

Merged
merged 4 commits into from
Jun 8, 2024

Conversation

flpm
Copy link
Contributor

@flpm flpm commented May 24, 2024

Some tests fail on my machine but they are related to xargs:

============================================================================= short test summary info =============================================================================
ERROR tests/test_cli.py::test_process_image_full - OSError: [Errno 95] Operation not supported: b'/tmp/pytest-of-felipe/pytest-30/test_process_image_full0/test.png'
ERROR tests/test_cli.py::test_main_access_cli[--version-0] - OSError: [Errno 95] Operation not supported: b'/tmp/pytest-of-felipe/pytest-30/test_main_access_cli___version0/test.png'
ERROR tests/test_cli.py::test_main_access_cli[-1] - OSError: [Errno 95] Operation not supported: b'/tmp/pytest-of-felipe/pytest-30/test_main_access_cli__1_0/test.png'
ERROR tests/test_cli.py::test_main - OSError: [Errno 95] Operation not supported: b'/tmp/pytest-of-felipe/pytest-30/test_main0/test.png'
=========================================================================== 4 passed, 4 errors in 0.16s ===========================================================================

For reference, architecture info

Linux 6.8.0-76060800daily20240311-generic #202403110203~1714077665~22.04~4c8e9a0~dev-Ubuntu SMP PREEMPT_DY x86_64 x86_64 x86_64 GNU/Linux

@stefmolin
Copy link
Owner

Do you mean xattr?

@flpm
Copy link
Contributor Author

flpm commented May 25, 2024

Yep. Autocorrect haha

@flpm
Copy link
Contributor Author

flpm commented May 25, 2024

The error is in the setup of the test. Here are more details.

___________________________________________________________________ ERROR at setup of test_main_access_cli[-1] ____________________________________________________________________
tests/test_cli.py:33: in image_with_metadata
    xattr(image_with_exif_data).set('the.limit.does.not.exist', b'\x00')
        image_with_exif_data = PosixPath('/tmp/pytest-of-felipe/pytest-35/test_main_access_cli__1_0/test.png')
../venv-exif/lib/python3.10/site-packages/xattr/__init__.py:78: in set
    return self._call(_setxattr, _fsetxattr, name, value, 0, options | self.options)
        name       = 'the.limit.does.not.exist'
        options    = 0
        self       = <xattr file=PosixPath('/tmp/pytest-of-felipe/pytest-35/test_main_access_cli__1_0/test.png')>
        value      = b'\x00'
../venv-exif/lib/python3.10/site-packages/xattr/__init__.py:60: in _call
    return name_func(self.value, *args)
        args       = ('the.limit.does.not.exist', b'\x00', 0, 0)
        fd_func    = <function _fsetxattr at 0x758cdd614d30>
        name_func  = <function _setxattr at 0x758cdd614ca0>
        self       = <xattr file=PosixPath('/tmp/pytest-of-felipe/pytest-35/test_main_access_cli__1_0/test.png')>
../venv-exif/lib/python3.10/site-packages/xattr/lib.py:77: in _setxattr
    raise error(path)
        name       = b'the.limit.does.not.exist'
        options    = 0
        path       = b'/tmp/pytest-of-felipe/pytest-35/test_main_access_cli__1_0/test.png'
        position   = 0
        res        = -1
        value      = b'\x00'
../venv-exif/lib/python3.10/site-packages/xattr/lib.py:28: in error
    raise IOError(errno, strerror, path)
E   OSError: [Errno 95] Operation not supported: b'/tmp/pytest-of-felipe/pytest-35/test_main_access_cli__1_0/test.png'
        errno      = 95
        path       = b'/tmp/pytest-of-felipe/pytest-35/test_main_access_cli__1_0/test.png'
        strerror   = 'Operation not supported'

I installed xattr and manually I can set attributes on those files, I am not sure why it does not work from Python. I will continue investigating.

Copy link

codecov bot commented Jun 1, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@stefmolin
Copy link
Owner

stefmolin commented Jun 1, 2024

Something to try to fix the Linux tests from the xattr page on PyPI:

Note: On Linux, custom xattr keys need to be prefixed with the user namespace, ie: user.your_attr.

@stefmolin
Copy link
Owner

I fixed the Linux tests in #14

@stefmolin stefmolin merged commit 07145b5 into stefmolin:main Jun 8, 2024
19 checks passed
stefmolin added a commit that referenced this pull request Oct 5, 2024
Co-authored-by: Stefanie Molin <24376333+stefmolin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants