From 88176aba36f3dcd2aced8930d37278132e7ba82c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20L=C3=B3pez?= Date: Fri, 31 May 2024 15:07:06 -0600 Subject: [PATCH] lint --- mongoengine_plus/types/encrypted_string/__init__.py | 1 - tests/types/test_encrypted_string.py | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mongoengine_plus/types/encrypted_string/__init__.py b/mongoengine_plus/types/encrypted_string/__init__.py index d6a4610..d86f6ee 100644 --- a/mongoengine_plus/types/encrypted_string/__init__.py +++ b/mongoengine_plus/types/encrypted_string/__init__.py @@ -1,7 +1,6 @@ __all__ = ['EncryptedString', 'patch_kms_request'] import codecs -import os import boto3 from pymongo.encryption import _EncryptionIO diff --git a/tests/types/test_encrypted_string.py b/tests/types/test_encrypted_string.py index 614a8a7..bc640cb 100644 --- a/tests/types/test_encrypted_string.py +++ b/tests/types/test_encrypted_string.py @@ -1,4 +1,5 @@ from functools import partial +from typing import Generator from unittest.mock import patch import pytest @@ -29,7 +30,7 @@ class User(Document): @pytest.fixture -def user() -> User: +def user() -> Generator[User, None, None]: user = User(name='Frida Kahlo', nss='123456') user.save() yield user @@ -134,9 +135,10 @@ def test_patch_kms_request(kms_connection_url: str) -> None: original_kms_request = _EncryptionIO.kms_request import boto3 - # Since we're using a self-signed certificate with the moto_server for testing, - # we need to patch boto3.client to disable certificate verification. - # This is a workaround and should not be done in production environments. + # Since we're using a self-signed certificate with the moto_server + # for testing, we need to patch boto3.client to disable + # certificate verification. This is a workaround and should not be done + # in production environments. with patch('boto3.client', partial(boto3.client, verify=False)): patch_kms_request( EncryptedString.key_namespace,