File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 8282@contextlib .contextmanager
8383def _suppress_deprecation_warning () -> Generator [None , None , None ]:
8484 with warnings .catch_warnings ():
85- warnings .filterwarnings ("ignore" , category = DeprecationWarning )
85+ warnings .simplefilter ("ignore" , DeprecationWarning )
8686 yield
8787
8888
@@ -313,6 +313,24 @@ class itself.
313313 assert Git .USE_SHELL is original_value
314314
315315
316+ def test_execute_without_shell_arg_does_not_warn () -> None :
317+ """No deprecation warning is issued from operations implemented using Git.execute().
318+
319+ When no ``shell`` argument is passed to Git.execute, which is when the value of
320+ USE_SHELL is to be used, the way Git.execute itself accesses USE_SHELL does not
321+ issue a deprecation warning.
322+ """
323+ with warnings .catch_warnings ():
324+ for category in DeprecationWarning , PendingDeprecationWarning :
325+ warnings .filterwarnings (
326+ action = "error" ,
327+ category = category ,
328+ module = r"git(?:\.|$)" ,
329+ )
330+
331+ Git ().version ()
332+
333+
316334_EXPECTED_DIR_SUBSET = {
317335 "cat_file_all" ,
318336 "cat_file_header" ,
You can’t perform that action at this time.
0 commit comments