Running test_code_module afte test_idle, which somewhere executes idle code that sets sys.ps1, exposed a deficiency in test_code_module.
TestInteractiveConsole.test_ps1 is intended to test this code in InteractiveConsole.interact.
try:
sys.ps1
except AttributeError:
sys.ps1 = ">>> "
The existing test only tried to test the except branch, but without insuring that the AttributeError occurs. PR 4070 fixes that and adds a test of the try branch, that sys.ps1 is respected and left alone (and later used as it) when present. Ditto for test_ps2. |