From 8e4e1d6e4d542fdaaa46146e6c2fba8c3ae1d97f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 29 Jun 2024 21:43:04 -0400 Subject: [PATCH] Add a test to cover core.disable. Reveals EncodingWarning. Ref #685 --- keyring/core.py | 7 +++++++ pyproject.toml | 1 + 2 files changed, 8 insertions(+) diff --git a/keyring/core.py b/keyring/core.py index 3e888696..33832a62 100644 --- a/keyring/core.py +++ b/keyring/core.py @@ -37,6 +37,13 @@ def get_keyring() -> backend.KeyringBackend: def disable() -> None: """ Configure the null keyring as the default. + + >>> fs = getfixture('fs') + >>> disable() + >>> disable() + Traceback (most recent call last): + ... + RuntimeError: Refusing to overwrite... """ root = platform.config_root() try: diff --git a/pyproject.toml b/pyproject.toml index c415f11c..25074a80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,6 +46,7 @@ test = [ "pytest-ruff >= 0.2.1", # local + "pyfakefs", ] doc = [ # upstream