Fix pylint in ubuntutools/test/test_requestsync.py

pylint complains:

```
ubuntutools/test/test_requestsync.py:31:12: C0415: Import outside toplevel (keyring) (import-outside-toplevel)
ubuntutools/test/test_requestsync.py:33:12: W0707: Consider explicitly re-raising using 'except ModuleNotFoundError as exc' and 'raise ModuleNotFoundError('package python3-keyring is not installed') from exc' (raise-missing-from)
ubuntutools/test/test_requestsync.py:31:12: W0611: Unused import keyring (unused-import)
```
This commit is contained in:
Benjamin Drung 2025-12-03 13:51:50 +01:00
parent 768a517370
commit c8fe724560

View File

@ -28,6 +28,7 @@ class BinaryTests(unittest.TestCase):
def test_keyring_installed(self):
"""Smoke test for required lp api dependencies"""
try:
# pylint: disable-next=import-outside-toplevel,unused-import
import keyring # noqa: F401
except ModuleNotFoundError:
raise ModuleNotFoundError("package python3-keyring is not installed")
except ModuleNotFoundError as error:
raise ModuleNotFoundError("package python3-keyring is not installed") from error