fix failing tests on Azure Devops
This commit is contained in:
parent
19b16a49fe
commit
ecab884f56
|
@ -405,7 +405,17 @@ class ShellSidebarTest(unittest.TestCase):
|
|||
def setUpClass(cls):
|
||||
requires('gui')
|
||||
|
||||
try:
|
||||
orig_use_subprocess = idlelib.pyshell.use_subprocess
|
||||
except AttributeError:
|
||||
orig_use_subprocess = None
|
||||
idlelib.pyshell.use_subprocess = False
|
||||
def cleanup_use_subprocess():
|
||||
if orig_use_subprocess is not None:
|
||||
idlelib.pyshell.use_subprocess = orig_use_subprocess
|
||||
else:
|
||||
del idlelib.pyshell.use_subprocess
|
||||
cls.addClassCleanup(cleanup_use_subprocess)
|
||||
|
||||
cls.root = root = tk.Tk()
|
||||
root.withdraw()
|
||||
|
@ -497,7 +507,7 @@ class ShellSidebarTest(unittest.TestCase):
|
|||
for line_index, line in enumerate(input.split('\n')):
|
||||
if line_index > 0:
|
||||
text.event_generate('<<newline-and-indent>>')
|
||||
text.insert('insert', line)
|
||||
text.insert('insert', line, 'stdin')
|
||||
|
||||
def run_test_coroutine(self, coroutine):
|
||||
root = self.root
|
||||
|
@ -514,8 +524,8 @@ class ShellSidebarTest(unittest.TestCase):
|
|||
exception = exc
|
||||
root.quit()
|
||||
else:
|
||||
root.after_idle(after_callback)
|
||||
root.after(0, after_callback)
|
||||
root.after(1, root.after_idle, after_callback)
|
||||
root.after(0, root.after_idle, after_callback)
|
||||
root.mainloop()
|
||||
|
||||
if exception:
|
||||
|
|
Loading…
Reference in New Issue