Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tests/test_multiprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pytest

import keyring
from keyring.backends import fail


@pytest.fixture(autouse=True)
Expand All @@ -20,7 +21,22 @@ def subprocess_get():
keyring.get_password('test_app', 'test_user')


def _has_usable_keyring():
"""True when a non-fail backend is selected (see #737)."""
try:
return not isinstance(keyring.get_keyring(), fail.Keyring)
except Exception:
return False


pytestmark = [
pytest.mark.skipif(
not _has_usable_keyring(),
reason=(
"no usable keyring backend available; install a recommended "
"backend or keyrings.alt (#737)"
),
),
pytest.mark.xfail(
platform.system() == 'Linux',
reason="#410: keyring discovery fails intermittently",
Expand Down