Skip to content

Commit c1fb12e

Browse files
authored
gh-54781: Move Lib/tkinter/test/test_ttk/ to Lib/test/test_ttk/ (#94070)
* Move Lib/tkinter/test/test_tkinter/ to Lib/test/test_tkinter/. * Move Lib/tkinter/test/test_ttk/ to Lib/test/test_ttk/. * Add Lib/test/test_ttk/__init__.py based on test_ttk_guionly.py. * Add Lib/test/test_tkinter/__init__.py * Remove old Lib/test/test_tk.py. * Remove old Lib/test/test_ttk_guionly.py. * Add __main__ sub-modules. * Update imports and update references to rename files.
1 parent 47e3562 commit c1fb12e

29 files changed

+100
-109
lines changed

Lib/test/test_tk.py

Lines changed: 0 additions & 20 deletions
This file was deleted.
File renamed without changes.

Lib/test/test_tkinter/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os.path
2+
import unittest
3+
from test import support
4+
from test.support import import_helper
5+
6+
7+
if support.check_sanitizer(address=True, memory=True):
8+
raise unittest.SkipTest("Tests involving libX11 can SEGFAULT on ASAN/MSAN builds")
9+
10+
# Skip test if _tkinter wasn't built.
11+
import_helper.import_module('_tkinter')
12+
13+
# Skip test if tk cannot be initialized.
14+
support.requires('gui')
15+
16+
17+
def load_tests(*args):
18+
return support.load_package_tests(os.path.dirname(__file__), *args)

Lib/test/test_tkinter/__main__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from . import load_tests
2+
import unittest
3+
4+
unittest.main()
File renamed without changes.

Lib/tkinter/test/test_tkinter/test_colorchooser.py renamed to Lib/test/test_tkinter/test_colorchooser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22
import tkinter
33
from test.support import requires, swap_attr
4-
from tkinter.test.support import AbstractDefaultRootTest, AbstractTkTest
4+
from test.test_tkinter.support import AbstractDefaultRootTest, AbstractTkTest
55
from tkinter import colorchooser
66
from tkinter.colorchooser import askcolor
77
from tkinter.commondialog import Dialog

Lib/tkinter/test/test_tkinter/test_font.py renamed to Lib/test/test_tkinter/test_font.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import tkinter
33
from tkinter import font
44
from test.support import requires, gc_collect, ALWAYS_EQ
5-
from tkinter.test.support import AbstractTkTest, AbstractDefaultRootTest
5+
from test.test_tkinter.support import AbstractTkTest, AbstractDefaultRootTest
66

77
requires('gui')
88

Lib/tkinter/test/test_tkinter/test_geometry_managers.py renamed to Lib/test/test_tkinter/test_geometry_managers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from tkinter import TclError
55
from test.support import requires
66

7-
from tkinter.test.support import pixels_conv
8-
from tkinter.test.widget_tests import AbstractWidgetTest
7+
from test.test_tkinter.support import pixels_conv
8+
from test.test_tkinter.widget_tests import AbstractWidgetTest
99

1010
requires('gui')
1111

Lib/tkinter/test/test_tkinter/test_images.py renamed to Lib/test/test_tkinter/test_images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import tkinter
33
from test import support
44
from test.support import os_helper
5-
from tkinter.test.support import AbstractTkTest, AbstractDefaultRootTest, requires_tcl
5+
from test.test_tkinter.support import AbstractTkTest, AbstractDefaultRootTest, requires_tcl
66

77
support.requires('gui')
88

0 commit comments

Comments
 (0)