Skip to content

Commit 5d2d9d7

Browse files
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 3c8043d) Co-authored-by: Terry Jan Reedy <[email protected]>
1 parent c0327ce commit 5d2d9d7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

‎Lib/idlelib/idle_test/htest.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def _wrapper(parent): # htest #
6565
outwin.OutputWindow (indirectly being tested with grep test)
6666
'''
6767

68+
import idlelib.pyshell # Set Windows DPI awareness before Tk().
6869
from importlib import import_module
6970
import tkinter as tk
7071
from tkinter.ttk import Scrollbar
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Avoid small type when running htests. Since part of the purpose of human-
2+
viewed tests is to determine that widgets look right, it is important that
3+
they look the same for testing as when running IDLE.

0 commit comments

Comments
 (0)