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 a011765

Browse filesBrowse files
committed
Isolate the attack tests with setUp and tearDown methods
1 parent c7a9470 commit a011765
Copy full SHA for a011765

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+7
-1
lines changed

‎IPython/core/tests/test_interactiveshell.py

Copy file name to clipboardExpand all lines: IPython/core/tests/test_interactiveshell.py
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,11 +1112,17 @@ def foo(*args, **kwargs):
11121112
ip.Completer.custom_matchers.pop()
11131113

11141114

1115-
class TestShowTracebacksAttack(unittest.TestCase):
1115+
class TestShowTracebackAttack(unittest.TestCase):
11161116
"""Test that the interactive shell is resilient against the client attack of
11171117
manipulating the showtracebacks method. These attacks shouldn't result in an
11181118
unhandled exception in the kernel."""
11191119

1120+
def setUp(self):
1121+
self.orig_showtraceback = interactiveshell.InteractiveShell.showtraceback
1122+
1123+
def tearDown(self):
1124+
interactiveshell.InteractiveShell.showtraceback = self.orig_showtraceback
1125+
11201126
def test_set_show_tracebacks_none(self):
11211127
"""Test the case of the client setting showtracebacks to None"""
11221128

0 commit comments

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