Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-88496: IDLE - fix another test on macOS #104075

Merged
merged 1 commit into from
May 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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