bpo-33975: Avoid small type when running IDLE's htests. (GH-7944)

Import pyshell first in htest to call SetProcessDpiAwareness on Windows
before tkinter.Tk() is called for the htest. Apparently, 'root.destroy()'
undoes a previous 'root = Tk()'. Since IDLE unittests always destroy roots,
a unittest before an htest does not require anything more to work right.
Since part of the purpose of human-viewed tests is to determine that
widgets look right, it is important that they look the same for testing
as when running IDLE.
(cherry picked from commit 3c8043d8fa)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
Miss Islington (bot) 2018-06-26 21:37:51 -07:00 committed by GitHub
parent 79f70cee7b
commit ca97b64a65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -65,6 +65,7 @@ def _wrapper(parent): # htest #
outwin.OutputWindow (indirectly being tested with grep test)
'''
import idlelib.pyshell # Set Windows DPI awareness before Tk().
from importlib import import_module
import tkinter as tk
from tkinter.ttk import Scrollbar

View file

@ -0,0 +1,3 @@
Avoid small type when running htests. Since part of the purpose of human-
viewed tests is to determine that widgets look right, it is important that
they look the same for testing as when running IDLE.