Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4037108

Browse files
committed
Test that Git.execute's own read of USE_SHELL does not warn
+ Use simplefilter where we can (separate from this test).
1 parentfebda6f commit4037108

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

‎test/deprecation/test_cmd_git.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
@contextlib.contextmanager
8383
def_suppress_deprecation_warning()->Generator[None,None,None]:
8484
withwarnings.catch_warnings():
85-
warnings.filterwarnings("ignore",category=DeprecationWarning)
85+
warnings.simplefilter("ignore",DeprecationWarning)
8686
yield
8787

8888

@@ -313,6 +313,24 @@ class itself.
313313
assertGit.USE_SHELLisoriginal_value
314314

315315

316+
deftest_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+
withwarnings.catch_warnings():
324+
forcategoryinDeprecationWarning,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",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp