MCPcopy Index your code
hub / github.com/python/cpython / test_show_source

Method test_show_source

Lib/idlelib/idle_test/test_debugger.py:268–276  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

266 self.assertEqual(self.sv.get(1), '?.<module>(), line 2: ')
267
268 def test_show_source(self):
269 # Test the .show_source() method against a fixed test stack.
270 # Patch out the file list to monitor it
271 self.sv.flist = Mock()
272 # Patch out isfile to pretend file exists.
273 with patch('idlelib.debugger.os.path.isfile', return_value=True) as isfile:
274 self.sv.show_source(1)
275 isfile.assert_called_once_with('test_stackviewer.py')
276 self.sv.flist.open.assert_called_once_with('test_stackviewer.py')
277
278
279class NameSpaceTest(unittest.TestCase):

Callers

nothing calls this directly

Calls 4

MockClass · 0.90
patchFunction · 0.90
show_sourceMethod · 0.45

Tested by

no test coverage detected