File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 82
82
@contextlib .contextmanager
83
83
def _suppress_deprecation_warning () -> Generator [None , None , None ]:
84
84
with warnings .catch_warnings ():
85
- warnings .filterwarnings ("ignore" , category = DeprecationWarning )
85
+ warnings .simplefilter ("ignore" , DeprecationWarning )
86
86
yield
87
87
88
88
@@ -313,6 +313,24 @@ class itself.
313
313
assert Git .USE_SHELL is original_value
314
314
315
315
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
+
316
334
_EXPECTED_DIR_SUBSET = {
317
335
"cat_file_all" ,
318
336
"cat_file_header" ,
You can’t perform that action at this time.
0 commit comments