From d8e8704a4a9f078b7c9753b4d7441f98ba95e477 Mon Sep 17 00:00:00 2001 From: "Jon Michael Aanes (aider)" Date: Sun, 16 Mar 2025 22:08:41 +0100 Subject: [PATCH] style: Run linter and format test_myanimelist.py for consistency --- tests/test_myanimelist.py | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/tests/test_myanimelist.py b/tests/test_myanimelist.py index e638ef3..5d00af2 100644 --- a/tests/test_myanimelist.py +++ b/tests/test_myanimelist.py @@ -1,19 +1,30 @@ import pytest + from personal_data.fetchers.myanimelist import parse_name -@pytest.mark.parametrize("input_str, expected_group1, expected_group2", [ - ('"Soundscape"', "Soundscape", None), - ('"Soundscape (サウンドスケープ)"', "Soundscape", "サウンドスケーブ"), - ('1: "Soundscape"', "Soundscape", None), - ('2: "Soundscape (サウンドスケーブ)"', "Soundscape", "サウンドスケーブ"), -]) + +@pytest.mark.parametrize( + 'input_str, expected_group1, expected_group2', + [ + ('"Soundscape"', 'Soundscape', None), + ('"Soundscape (サウンドスケープ)"', 'Soundscape', 'サウンドスケーブ'), + ('1: "Soundscape"', 'Soundscape', None), + ('2: "Soundscape (サウンドスケーブ)"', 'Soundscape', 'サウンドスケーブ'), + ], +) def test_parse_name(input_str, expected_group1, expected_group2): m = parse_name(input_str) - assert m is not None, f"parse_name returned None for input: {input_str}" + assert m is not None, f'parse_name returned None for input: {input_str}' actual_group1 = m.group(1).strip() if m.group(1) is not None else None actual_group2 = m.group(2).strip() if m.group(2) is not None else None - assert actual_group1 == expected_group1, f"Expected group(1): {expected_group1} but got: {actual_group1}" + assert actual_group1 == expected_group1, ( + f'Expected group(1): {expected_group1} but got: {actual_group1}' + ) if expected_group2 is None: - assert actual_group2 is None, f"Expected group(2) to be None but got: {actual_group2}" + assert actual_group2 is None, ( + f'Expected group(2) to be None but got: {actual_group2}' + ) else: - assert actual_group2 == expected_group2, f"Expected group(2): {expected_group2} but got: {actual_group2}" + assert actual_group2 == expected_group2, ( + f'Expected group(2): {expected_group2} but got: {actual_group2}' + )