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

Appearance settings

Commit 4037108

Browse filesBrowse 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 parent febda6f commit 4037108
Copy full SHA for 4037108

File tree

Expand file treeCollapse file tree

1 file changed

+19
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+19
-1
lines changed

‎test/deprecation/test_cmd_git.py

Copy file name to clipboardExpand all lines: test/deprecation/test_cmd_git.py
+19-1Lines 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
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",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.