summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_code_module.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2017-10-28 01:45:19 (GMT)
committerGitHub <noreply@github.com>2017-10-28 01:45:19 (GMT)
commit5a4bbcd479ce86f68bbe12bc8c16e3447f32e13a (patch)
tree33457c5ea26acc7652a7d6119bf842306e857fad /Lib/test/test_code_module.py
parente86172d63af5827a3c2b55b80351cb38a26190eb (diff)
downloadcpython-5a4bbcd479ce86f68bbe12bc8c16e3447f32e13a.zip
cpython-5a4bbcd479ce86f68bbe12bc8c16e3447f32e13a.tar.gz
cpython-5a4bbcd479ce86f68bbe12bc8c16e3447f32e13a.tar.bz2
bpo-31836: Test_code_module now passes with sys.ps1, ps2 set (#4070)
Diffstat (limited to 'Lib/test/test_code_module.py')
-rw-r--r--Lib/test/test_code_module.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_code_module.py b/Lib/test/test_code_module.py
index 1a8f699..24db0ac 100644
--- a/Lib/test/test_code_module.py
+++ b/Lib/test/test_code_module.py
@@ -28,16 +28,24 @@ class TestInteractiveConsole(unittest.TestCase):
self.sysmod = stack.enter_context(prepatch)
if sys.excepthook is sys.__excepthook__:
self.sysmod.excepthook = self.sysmod.__excepthook__
+ del self.sysmod.ps1
+ del self.sysmod.ps2
def test_ps1(self):
self.infunc.side_effect = EOFError('Finished')
self.console.interact()
self.assertEqual(self.sysmod.ps1, '>>> ')
+ self.sysmod.ps1 = 'custom1> '
+ self.console.interact()
+ self.assertEqual(self.sysmod.ps1, 'custom1> ')
def test_ps2(self):
self.infunc.side_effect = EOFError('Finished')
self.console.interact()
self.assertEqual(self.sysmod.ps2, '... ')
+ self.sysmod.ps1 = 'custom2> '
+ self.console.interact()
+ self.assertEqual(self.sysmod.ps1, 'custom2> ')
def test_console_stderr(self):
self.infunc.side_effect = ["'antioch'", "", EOFError('Finished')]