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

bpo-33987: IDLE - use ttk Frame for ttk widgets #11395

Merged
merged 7 commits into from
Jan 3, 2019

Conversation

terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Dec 31, 2018

@terryjreedy terryjreedy self-assigned this Dec 31, 2018
@terryjreedy terryjreedy changed the title bpo-33987: IDLE - use ttk Frame for SearchDialogBase bpo-33987: IDLE - use ttk Frame for ttk widgets Dec 31, 2018
@terryjreedy
Copy link
Member Author

Left editor and help for later due to 'background' issue. See issue for more.

@csabella
Copy link
Contributor

csabella commented Jan 2, 2019

I'm getting the same error on Ubuntu as on the CI.

======================================================================
FAIL: test_make_frame (idlelib.idle_test.test_searchbase.SearchDialogBaseTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/cheryl/cpython/Lib/idlelib/idle_test/test_searchbase.py", line 101, in test_make_frame
    self.assertIsInstance(frame, Frame)
AssertionError: <tkinter.ttk.Frame object .!frame7> is not an instance of <class 'tkinter.ttk.Frame'>

----------------------------------------------------------------------

If you want me to look into in more detail, let me know.

@terryjreedy
Copy link
Member Author

terryjreedy commented Jan 2, 2019

Puzzling. I got same error running test_idle during development, made the change to test_searchbase to fix it, hit F5, and the test then passed (as is still does). I pushed -- without re-running test_idle. This equivalent to F5 in the file also passes.

python -m unittest -v idlelib.idle_test.test_searchbase

The failure is on line 101, the first of two isinstance tests. So the issue is not doing two tests in one method. Commenting out 101 results in line 105 failing.

These fail.

python -m test.test_idle
python -m test -ugui test_idle # and even
python -m test -ugui -m test_searchbase test_idle
The first runs test directly with unittest.main, the others via regrtest, both after executing the code before the if __name__ clause. The third indicates that the failure is not leftover changes from other tests. Tentative conclusion: something in the always executed part of test_idle affects the test environment.

Adding a debug print verifies that frame is an instance of some ttk.Frame but that the test fails when there are two ttk.Frame classes.
print('\n*** ', type(frame), id(type(frame)), id(Frame))
*** <class 'tkinter.ttk.Frame'> 71194576 71194576 # pass (unittest called directly)
*** <class 'tkinter.ttk.Frame'> 71986080 112237472 # fail (test_idle run)

I have not found a single culprit in test_idle, and when I run it from an IDLE editor, there is no failure. After changing the test to a klutzy workaround, the three command lines above pass.

See terryjreedy comment in issue 33987 pr 11395.
@terryjreedy terryjreedy merged commit aff0ada into python:master Jan 3, 2019
@miss-islington
Copy link
Contributor

Thanks @terryjreedy for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@terryjreedy terryjreedy deleted the ttkframe branch January 3, 2019 03:04
@bedevere-bot
Copy link

GH-11419 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 3, 2019
(cherry picked from commit aff0ada)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
miss-islington added a commit that referenced this pull request Jan 3, 2019
(cherry picked from commit aff0ada)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants