Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-88496: IDLE - fix another test on macOS
Needed for Catalina: test_sidebar add 'idletasks' and skip assert.
  • Loading branch information
terryjreedy committed May 2, 2023
commit fd0948ade7339b585ec86bb19e3dfd7185efaeb3
5 changes: 3 additions & 2 deletions Lib/idlelib/idle_test/test_sidebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
cls.editwin.per.close()
cls.root.update()
cls.root.update_idletasks()
cls.root.destroy()
del cls.text, cls.text_frame, cls.editwin, cls.root

Expand Down Expand Up @@ -695,7 +695,8 @@ def test_mousewheel(self):
delta = -1 if sys.platform == 'darwin' else 120
sidebar.canvas.event_generate('<MouseWheel>', x=0, y=0, delta=delta)
yield
self.assertIsNone(text.dlineinfo(text.index(f'{last_lineno}.0')))
if sys.platform != 'darwin': # .update_idletasks() does not work.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ordinarily I would ask if this test should continue to run on XQuartz if the problem is only on Aqua:

Suggested change
if sys.platform != 'darwin': # .update_idletasks() does not work.
if text._windowingsystem != 'aqua': # .update_idletasks() does not work.

But this test was already failing on Aqua and XQuartz due to incorrectly negative delta. So this failure may have nothing to do with .update_idletasks(), and the test should not be skipped on Aqua or XQuartz. See #103820, #103821

self.assertIsNone(text.dlineinfo(text.index(f'{last_lineno}.0')))

# Scroll back down using the <Button-5> event.
sidebar.canvas.event_generate('<Button-5>', x=0, y=0)
Expand Down