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

Method setUp

Lib/test/test_remote_pdb.py:835–856  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

833 """Tests for the _PdbServer class."""
834
835 def setUp(self):
836 self.sockfile = MockSocketFile()
837 self.pdb = _PdbServer(self.sockfile)
838
839 # Mock some Bdb attributes that are lazily created when tracing starts
840 self.pdb.botframe = None
841 self.pdb.quitting = False
842
843 # Create a frame for testing
844 self.test_globals = {'a': 1, 'b': 2, '__pdb_convenience_variables': {'x': 100}}
845 self.test_locals = {'c': 3, 'd': 4}
846
847 # Create a simple test frame
848 frame_info = unittest.mock.Mock()
849 frame_info.f_globals = self.test_globals
850 frame_info.f_locals = self.test_locals
851 frame_info.f_lineno = 42
852 frame_info.f_code = unittest.mock.Mock()
853 frame_info.f_code.co_filename = "test_file.py"
854 frame_info.f_code.co_name = "test_function"
855
856 self.pdb.curframe = frame_info
857
858 def test_message_and_error(self):
859 """Test message and error methods send correct JSON."""

Callers

nothing calls this directly

Calls 2

_PdbServerClass · 0.90
MockSocketFileClass · 0.85

Tested by

no test coverage detected