1818from datetime import datetime , timezone
1919from pathlib import Path
2020from types import MethodType , SimpleNamespace
21- from typing import Any , Optional , Union , cast
21+ from typing import Any , cast
2222from unittest .mock import MagicMock , patch
2323from zipfile import ZipFile
2424
@@ -94,7 +94,7 @@ def get_filesystem(parameter_editor: ParameterEditor) -> LocalFilesystem:
9494def configure_filesystem (
9595 parameter_editor : ParameterEditor ,
9696 vehicle_dir : Path ,
97- parameter_files : Optional [ list [str ]] = None ,
97+ parameter_files : list [str ] | None = None ,
9898) -> LocalFilesystem :
9999 """Configure filesystem directory and parameter files for a test."""
100100 filesystem = get_filesystem (parameter_editor )
@@ -106,8 +106,8 @@ def configure_filesystem(
106106def create_forum_help_zip (
107107 parameter_editor : ParameterEditor ,
108108 * ,
109- show_info : Optional [ MagicMock ] = None ,
110- show_error : Optional [ MagicMock ] = None ,
109+ show_info : MagicMock | None = None ,
110+ show_error : MagicMock | None = None ,
111111) -> Path :
112112 """Execute the public workflow helper and return the created zip path."""
113113 info_callback = show_info or MagicMock ()
@@ -131,7 +131,7 @@ def create_forum_help_zip(
131131def setup_zip_mock (
132132 parameter_editor : ParameterEditor ,
133133 vehicle_dir : Path ,
134- file_parameters : Mapping [str , Union [ ParDict , Mapping [str , Any ], None ] ],
134+ file_parameters : Mapping [str , ParDict | Mapping [str , Any ] | None ],
135135 configuration_steps_filename : str = "configuration_steps_ArduCopter.json" ,
136136) -> None :
137137 """
0 commit comments