Skip to content

Commit b25ddf5

Browse files
committed
add test
1 parent f6efdf6 commit b25ddf5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lib/test/test_pdb.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4753,6 +4753,16 @@ def foo(self):
47534753
stdout, stderr = self.run_pdb_script(script, commands)
47544754
self.assertIn("The specified object 'C.foo' is not a function", stdout)
47554755

4756+
def test_pyrepl_available(self):
4757+
with patch.dict(os.environ, {"PYTHON_BASIC_REPL": "1"}):
4758+
self.assertFalse(pdb._pyrepl_available())
4759+
4760+
with patch.dict(os.environ, {}, clear=True):
4761+
mod = types.ModuleType("_pyrepl.main")
4762+
mod.CAN_USE_PYREPL = True
4763+
with patch.dict("sys.modules", {"_pyrepl.main": mod}):
4764+
self.assertTrue(pdb._pyrepl_available())
4765+
47564766

47574767
class ChecklineTests(unittest.TestCase):
47584768
def setUp(self):

0 commit comments

Comments
 (0)