@@ -94,9 +94,9 @@ def test_keymap_function_keys_present():
9494def _fake_run (captured ):
9595 def runner (argv , ** _kwargs ):
9696 captured .append (list (argv ))
97+ # CompletedProcess is a *constructor* (not a process spawn);
98+ # used here to mock subprocess.run's return value.
9799 # nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
98- # reason: CompletedProcess is a *constructor* (not a call to
99- # spawn a process); used here to mock subprocess.run's return.
100100 result = subprocess .CompletedProcess (argv , 0 , b"" , b"" )
101101 return result
102102 return runner
@@ -230,11 +230,11 @@ def test_mouse_raises_when_ydotool_missing():
230230
231231def test_screenshot_calls_grim_with_path ():
232232 captured : list = []
233- # nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
234- # reason: CompletedProcess constructor used to mock subprocess.run.
233+ # CompletedProcess constructor used to mock subprocess.run.
235234 with patch .object (wayland_screen , "binary_path" ,
236235 return_value = "/usr/bin/grim" ), \
237236 patch .object (wayland_screen .subprocess , "run" ,
237+ # nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit
238238 side_effect = lambda argv , ** kw : (captured .append (argv )
239239 or subprocess .CompletedProcess (argv , 0 , b"" , b"" ))):
240240 wayland_screen .screenshot ("out.png" )
0 commit comments