From c654317b8fb9920c911bc011de79c3e22c7f0347 Mon Sep 17 00:00:00 2001 From: Denis Anikin Date: Sat, 22 Oct 2022 05:03:25 +0300 Subject: [PATCH] Pylint fixes --- Makefile | 2 +- tests/test_dict_views.py | 8 ++++++-- whole_app/dictionaries/file.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 69d8fb7..157ac14 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ lint: isort -c . black . --check lint-in-docker: - docker run -t spellcheck-microservice bash -c "pylint --load-plugins pylint_pydantic whole_app tests && mypy . && vulture whole_app --min-confidence 100" + docker run -t spellcheck-microservice bash -c "pylint --load-plugins pylint_pydantic whole_app tests && mypy . && vulture whole_app --min-confidence 100" run-prod: docker run -p 10113:10113 -e SPELLCHECK_WORKERS=1 -t spellcheck-microservice:latest check-languages: diff --git a/tests/test_dict_views.py b/tests/test_dict_views.py index fc9669f..8581aa3 100644 --- a/tests/test_dict_views.py +++ b/tests/test_dict_views.py @@ -28,7 +28,9 @@ def test_add_to_dict(self, app_client, faker_obj, _patch_various_providers): """Add to user dict.""" fake_user_name: typing.Final[str] = faker_obj.user_name() fake_exc_word: typing.Final[str] = faker_obj.word() - path_to_dict_file: typing.Final[str] = SETTINGS.dictionaries_path.joinpath(fake_user_name) + path_to_dict_file: typing.Final[str] = SETTINGS.dictionaries_path.joinpath( # pylint: disable=no-member + fake_user_name + ) server_response: RequestsResponse = app_client.post( DICT_ENDPOINT, json=models.UserDictionaryRequestWithWord(user_name=fake_user_name, exception_word=fake_exc_word).dict(), @@ -42,7 +44,9 @@ def test_remove_from_user_dict(self, app_client, faker_obj, _patch_various_provi """Delete from user dict.""" fake_exc_word: typing.Final[str] = faker_obj.word() fake_user_name: typing.Final[str] = faker_obj.user_name() - path_to_dict_file: typing.Final[str] = SETTINGS.dictionaries_path.joinpath(fake_user_name) + path_to_dict_file: typing.Final[str] = SETTINGS.dictionaries_path.joinpath( # pylint: disable=no-member + fake_user_name + ) path_to_dict_file.touch() path_to_dict_file.write_text(fake_exc_word) if SETTINGS.dictionaries_storage_provider == StorageProviders.FILE: diff --git a/whole_app/dictionaries/file.py b/whole_app/dictionaries/file.py index e733335..52c145c 100644 --- a/whole_app/dictionaries/file.py +++ b/whole_app/dictionaries/file.py @@ -6,7 +6,7 @@ def init_storage() -> None: """Initialize dictionaries storage helper.""" - SETTINGS.dictionaries_path.mkdir(parents=True, exist_ok=True) + SETTINGS.dictionaries_path.mkdir(parents=True, exist_ok=True) # pylint: disable=no-member class FileProvider: