mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-02 20:15:24 +02:00
chore: upgrade pre-commit hooks (#1735)
* change pep585 hook to pyupgrade * run pyupgrade + cleanup lint errors
This commit is contained in:
parent
e516a2e801
commit
a8f0fb14a7
13 changed files with 79 additions and 83 deletions
|
@ -11,7 +11,7 @@ from tests.utils.fixture_schemas import TestUser
|
|||
|
||||
def test_recipe_repo_get_by_categories_basic(database: AllRepositories, unique_user: TestUser):
|
||||
# Bootstrap the database with categories
|
||||
slug1, slug2, slug3 = [random_string(10) for _ in range(3)]
|
||||
slug1, slug2, slug3 = (random_string(10) for _ in range(3))
|
||||
|
||||
categories: list[CategoryOut | CategorySave] = [
|
||||
CategorySave(group_id=unique_user.group_id, name=slug1, slug=slug1),
|
||||
|
@ -68,7 +68,7 @@ def test_recipe_repo_get_by_categories_basic(database: AllRepositories, unique_u
|
|||
|
||||
|
||||
def test_recipe_repo_get_by_categories_multi(database: AllRepositories, unique_user: TestUser):
|
||||
slug1, slug2 = [random_string(10) for _ in range(2)]
|
||||
slug1, slug2 = (random_string(10) for _ in range(2))
|
||||
|
||||
categories = [
|
||||
CategorySave(group_id=unique_user.group_id, name=slug1, slug=slug1),
|
||||
|
@ -120,7 +120,7 @@ def test_recipe_repo_get_by_categories_multi(database: AllRepositories, unique_u
|
|||
|
||||
|
||||
def test_recipe_repo_pagination_by_categories(database: AllRepositories, unique_user: TestUser):
|
||||
slug1, slug2 = [random_string(10) for _ in range(2)]
|
||||
slug1, slug2 = (random_string(10) for _ in range(2))
|
||||
|
||||
categories = [
|
||||
CategorySave(group_id=unique_user.group_id, name=slug1, slug=slug1),
|
||||
|
@ -201,7 +201,7 @@ def test_recipe_repo_pagination_by_categories(database: AllRepositories, unique_
|
|||
|
||||
|
||||
def test_recipe_repo_pagination_by_tags(database: AllRepositories, unique_user: TestUser):
|
||||
slug1, slug2 = [random_string(10) for _ in range(2)]
|
||||
slug1, slug2 = (random_string(10) for _ in range(2))
|
||||
|
||||
tags = [
|
||||
TagSave(group_id=unique_user.group_id, name=slug1, slug=slug1),
|
||||
|
@ -280,7 +280,7 @@ def test_recipe_repo_pagination_by_tags(database: AllRepositories, unique_user:
|
|||
|
||||
|
||||
def test_recipe_repo_pagination_by_tools(database: AllRepositories, unique_user: TestUser):
|
||||
slug1, slug2 = [random_string(10) for _ in range(2)]
|
||||
slug1, slug2 = (random_string(10) for _ in range(2))
|
||||
|
||||
tools = [
|
||||
RecipeToolSave(group_id=unique_user.group_id, name=slug1, slug=slug1),
|
||||
|
|
|
@ -11,7 +11,7 @@ ocr_service = OcrService()
|
|||
def test_image_to_string():
|
||||
with open(Path("tests/data/images/test-ocr.png"), "rb") as image:
|
||||
result = ocr_service.image_to_string(image)
|
||||
with open(Path("tests/data/text/test-ocr.txt"), "r", encoding="utf-8") as expected_result:
|
||||
with open(Path("tests/data/text/test-ocr.txt"), encoding="utf-8") as expected_result:
|
||||
assert result == expected_result.read()
|
||||
|
||||
|
||||
|
@ -19,7 +19,7 @@ def test_image_to_string():
|
|||
def test_image_to_tsv():
|
||||
with open(Path("tests/data/images/test-ocr.png"), "rb") as image:
|
||||
result = ocr_service.image_to_tsv(image.read())
|
||||
with open(Path("tests/data/text/test-ocr.tsv"), "r", encoding="utf-8") as expected_result:
|
||||
with open(Path("tests/data/text/test-ocr.tsv"), encoding="utf-8") as expected_result:
|
||||
assert result == expected_result.read()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue