diff --git a/glotaran/builtin/io/folder/test/test_folder_plugin.py b/glotaran/builtin/io/folder/test/test_folder_plugin.py index 8aab0893b..839105408 100644 --- a/glotaran/builtin/io/folder/test/test_folder_plugin.py +++ b/glotaran/builtin/io/folder/test/test_folder_plugin.py @@ -5,9 +5,9 @@ import pytest -from glotaran.io import save_result from glotaran.analysis.optimize import optimize from glotaran.examples.sequential_spectral_decay import SCHEME +from glotaran.io import save_result from glotaran.project.result import Result @@ -21,7 +21,7 @@ def dummy_result(): @pytest.mark.parametrize("format_name", ("folder", "legacy")) def test_save_result_folder( tmp_path: Path, - dummy_result: Result, # noqa: F811 + dummy_result: Result, format_name: Literal["folder", "legacy"], ): """Check all files exist.""" @@ -48,7 +48,7 @@ def test_save_result_folder( @pytest.mark.parametrize("format_name", ("folder", "legacy")) def test_save_result_folder_error_path_is_file( tmp_path: Path, - dummy_result: Result, # noqa: F811 + dummy_result: Result, format_name: Literal["folder", "legacy"], ): """Raise error if result_path is a file without extension and overwrite is true.""" diff --git a/glotaran/builtin/io/yml/test/test_save_result.py b/glotaran/builtin/io/yml/test/test_save_result.py index 65c2adeb2..c5c102cad 100644 --- a/glotaran/builtin/io/yml/test/test_save_result.py +++ b/glotaran/builtin/io/yml/test/test_save_result.py @@ -1,14 +1,15 @@ from __future__ import annotations +from dataclasses import replace from pathlib import Path from textwrap import dedent + import pytest -from dataclasses import replace from glotaran import __version__ -from glotaran.io import save_result from glotaran.analysis.optimize import optimize from glotaran.examples.sequential_spectral_decay import SCHEME +from glotaran.io import save_result from glotaran.project.result import Result @@ -22,7 +23,7 @@ def dummy_result(): def test_save_result_yml( tmp_path: Path, - dummy_result: Result, # noqa: F811 + dummy_result: Result, ): """Check all files exist.""" expected = dedent( diff --git a/glotaran/deprecation/modules/test/test_project_result.py b/glotaran/deprecation/modules/test/test_project_result.py index 1f6e5188d..b7a6595c2 100644 --- a/glotaran/deprecation/modules/test/test_project_result.py +++ b/glotaran/deprecation/modules/test/test_project_result.py @@ -1,7 +1,6 @@ """Test deprecated functionality in 'glotaran.project.result'.""" from __future__ import annotations - import pytest from glotaran.analysis.optimize import optimize @@ -17,7 +16,7 @@ def dummy_result(): yield optimize(SCHEME, raise_exception=True) -def test_Result_get_dataset_method(dummy_result: Result): # noqa: F811 +def test_Result_get_dataset_method(dummy_result: Result): """Result.get_dataset(dataset_label) gives correct dataset.""" _, result = deprecation_warning_on_call_test_helper( @@ -27,7 +26,7 @@ def test_Result_get_dataset_method(dummy_result: Result): # noqa: F811 assert result == dummy_result.data["dataset_1"] -def test_Result_get_dataset_method_error(dummy_result: Result): # noqa: F811 +def test_Result_get_dataset_method_error(dummy_result: Result): """Result.get_dataset(dataset_label) error on wrong key.""" with pytest.raises(ValueError, match="Unknown dataset 'foo'"):