jaraco / keyring

MIT License
1.24k stars 152 forks source link

Windows and MacOS units fail discovery on Linux #676

Open jaraco opened 4 months ago

jaraco commented 4 months ago

Just tested 25.1.0 and looks like now Windows and MacOS units are executed on Linux

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-keyring-25.1.0~no_loopy_deps-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-keyring-25.1.0~no_loopy_deps-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ dbus-run-session -- /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0
rootdir: /home/tkloczko/rpmbuild/BUILD/keyring-25.1.0
configfile: pytest.ini
plugins: flake8-1.1.1
collected 83 items / 2 errors

========================================================================================== ERRORS ===========================================================================================
______________________________________________________________________ ERROR collecting tests/backends/test_Windows.py ______________________________________________________________________
tests/backends/test_Windows.py:10: in <module>
    not keyring.backends.Windows.WinVaultKeyring.viable, reason="Needs Windows"
E   AttributeError: module 'keyring.backends' has no attribute 'Windows'
_______________________________________________________________________ ERROR collecting tests/backends/test_macOS.py _______________________________________________________________________
tests/backends/test_macOS.py:9: in <module>
    not keyring.backends.macOS.Keyring.viable,
E   AttributeError: module 'keyring.backends' has no attribute 'macOS'
================================================================================== short test summary info ==================================================================================
ERROR tests/backends/test_Windows.py - AttributeError: module 'keyring.backends' has no attribute 'Windows'
ERROR tests/backends/test_macOS.py - AttributeError: module 'keyring.backends' has no attribute 'macOS'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================== 2 errors in 0.36s =====================================================================================

Originally posted by @kloczek in https://github.com/jaraco/keyring/issues/581#issuecomment-2041182832

jaraco commented 4 months ago

See also the six comments from https://github.com/jaraco/keyring/issues/581#issuecomment-2041499294 where I've done some triage on this issue.

jaraco commented 4 months ago

I've been able to replicate the failure against a local checkout using:

FROM jaraco/multipy-tox

RUN py -m pip install pytest
WORKDIR src
CMD py -m pytest

And executing docker with -v @$(pwd):/src

jaraco commented 4 months ago

I've found that I can minimize the project quite a bit and the failure still occurs, but two different changes can work around the issue:

I think I'm getting close to a minimal reproducer.

jaraco commented 4 months ago

Reported issue upstream as https://github.com/pytest-dev/pytest/issues/12194.

jaraco commented 4 months ago

For reference, I pushed my minimizing troubleshooting to refs/archive/troubleshoot-676.