Repository navigation
test_idle test_configdialog.HighPageTest failing on macOS #134770
Copy link
Copy link
Open
Labels
Description
Bug report
Saw these failure on a normal macOS 13 runner:
======================================================================
ERROR: test_set_theme_type (idlelib.idle_test.test_configdialog.HighPageTest.test_set_theme_type)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/idlelib/idle_test/test_configdialog.py", line 295, in setUp
d.set_highlight_target.called = 0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'method' object has no attribute 'called' and no __dict__ for setting new attributes
======================================================================
ERROR: test_theme_source (idlelib.idle_test.test_configdialog.HighPageTest.test_theme_source)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/idlelib/idle_test/test_configdialog.py", line 295, in setUp
d.set_highlight_target.called = 0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'method' object has no attribute 'called' and no __dict__ for setting new attributes
======================================================================
ERROR: tearDownClass (idlelib.idle_test.test_configdialog.HighPageTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/idlelib/idle_test/test_configdialog.py", line 284, in tearDownClass
del d.set_highlight_target, d.set_color_sample
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'HighPage' object has no attribute 'set_highlight_target'. Did you mean: 'highlight_target'?
======================================================================
FAIL: test_delete_custom (idlelib.idle_test.test_configdialog.HighPageTest.test_delete_custom)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/runner/work/cpython/cpython/Lib/idlelib/idle_test/test_configdialog.py", line 748, in test_delete_custom
eq(d.custom_theme_on.state(), ())
~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Tuples differ: ('background',) != ()
First tuple contains 1 additional elements.
First extra element 0:
'background'
- ('background',)
+ ()
<snip>Example failed run:
https://github.com/python/cpython/actions/runs/15265517831/job/42930405567
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status
Activity
hugovk commentedon May 27, 2025
I restarted it and it passed this time: https://github.com/python/cpython/actions/runs/15265517831
emmatyping commentedon May 27, 2025
Thanks! That's even more confusing though :(
StanFromIreland commentedon May 27, 2025
I have seen this pop up several times over a few months.
cc expert @terryjreedy
[-]test_idle failing on macOS[/-][+]test_idle test_configdialog.HighPageTest failing on macOS[/+]terryjreedy commentedon May 27, 2025
Unittest separately reports Errors (unanticipated exceptions) and Failures (assertXXX not true). For test_configdialog.HighTest, there were 4 Failures and 3 Errors (in that order, the opposite of the report order). Including the 1 fail reported above, the failures are summarized as follows, in the order the tests methods are run.
I think 1. and 3. are some sort of very rare timing issues, but I am not sure how to fix. Perhaps such occur more often macOS 13 than macOS 10, the version when we wrote these tests. Beside the main issue, 1. adds custom mocks which are not deleted when the assert fails. I will fix this possible omission, in all IDLE test files, in a separate issue. I think this cleanup failure is the cause of 2. and maybe 4.
Failure 4. must have caused the 3 AttributeErrors by removing but not restoring the mock with the 'called' attribute. In the first,
dis an instance of idlelib.configdialog.HighPage.set_highlight_targetis an instance of idlelib.idle_test.mock_idle.Func mocking the method of the same name.calledis an attribute of the mock set in__init__and incremented in__calledand reset in setUp.This is the first report of such errors that I have seen in the last few years. macOS 13 seems flakier than some earlier versions. Are recent failures only on macOS? To fix the primary failures, I need more reports to to get a better idea of what fails. For instance, are some asserts failing multiple times, or are they more random. Links to failure runs, like the one above, are enough for me to make summaries like in this comment. (Easier after cascade failures are removed.)
ned-deily commentedon May 28, 2025
FWIW, I have never seen this particular kind of behavior of
test_idleon any version of macOS when doing installer sanity tests but those tests always run the test suite in the same order and run GUI-related tests, includingtest_idle, as separate test runs so there would be no interference from other tests or from random ordering of tests.StanFromIreland commentedon May 28, 2025
See this run from March (I hope the logs don't disappear), though it seems to have some slightly different fails.
sobolevn commentedon Jun 25, 2025
Similar error happened today: https://github.com/python/cpython/actions/runs/15870466272/job/44745627978?pr=135840
emmatyping commentedon Aug 7, 2025
Another instance here: https://github.com/python/cpython/actions/runs/16791013574/job/47552476050?pr=137496
terryjreedy commentedon Feb 2, 2026
Old test logs disappear, so the actual error reports of variable occasional failures need to be copied here.