From cb5966371c436a5336590f5acb03f6be33aaea31 Mon Sep 17 00:00:00 2001 From: jalapenopuzzle <8386278+jalapenopuzzle@users.noreply.github.com> Date: Tue, 8 Apr 2025 10:17:19 +1000 Subject: [PATCH] CAM: snapmaker unit tests fix type lint NOTE get_gcode() can return an argparse.Namespace if something goes wrong with parsing the arguments. This is contrary to the str specification. --- src/Mod/CAM/CAMTests/TestSnapmakerPost.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Mod/CAM/CAMTests/TestSnapmakerPost.py b/src/Mod/CAM/CAMTests/TestSnapmakerPost.py index a95a11a50f..a50782d77f 100644 --- a/src/Mod/CAM/CAMTests/TestSnapmakerPost.py +++ b/src/Mod/CAM/CAMTests/TestSnapmakerPost.py @@ -17,6 +17,7 @@ # * permissions and limitations under the Licence. * # *************************************************************************** import re +from typing import List import FreeCAD @@ -63,7 +64,7 @@ class TestSnapmakerPost(PathTestUtils.PathTestBase): """Unit test tear down""" pass - def get_gcode(self, ops: [str], arguments: str) -> str: + def get_gcode(self, ops: List[str], arguments: str) -> str: """Get postprocessed gcode from a list of operations and postprocessor arguments""" self.profile_op.Path = Path.Path(ops) self.job.PostProcessorArgs = "--no-show-editor --no-gui --no-thumbnail " + arguments