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-10572: Move tkinter tests to /test #18727

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion Lib/test/test_tk.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Skip test if tk cannot be initialized.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lib/__init__.py should be deleted.

support.requires('gui')

from tkinter.test import runtktests
from test.tkinter_test import runtktests

def test_main():
support.run_unittest(
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_ttk_guionly.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import tkinter
from _tkinter import TclError
from tkinter import ttk
from tkinter.test import runtktests
from test.tkinter_test import runtktests

root = None
try:
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_ttk_textonly.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Skip this test if _tkinter does not exist.
support.import_module('_tkinter')

from tkinter.test import runtktests
from test.tkinter_test import runtktests

def test_main():
support.run_unittest(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After moving the tests, files like this (just contains an import and a wrapper to interface runtests with test_ttk) end up being a slightly confusing, mostly unneeded layer.

As long as many files are moved and history is broken, why not also clean up this tangle by merging the compat layer into the real test files?

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_tests_modules(basepath=this_dir_path, gui=True, packages=None):
try:
yield importlib.import_module(
".%s.%s" % (pkg_name, name[:-len(py_ext)]),
"tkinter.test")
"test.tkinter_test")
except test.support.ResourceDenied:
if gui:
raise
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import tkinter
from tkinter import font
from test.support import requires, run_unittest, gc_collect, ALWAYS_EQ
from tkinter.test.support import AbstractTkTest
from test.tkinter_test.support import AbstractTkTest

requires('gui')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from tkinter import TclError
from test.support import requires

from tkinter.test.support import pixels_conv, tcl_version, requires_tcl
from tkinter.test.widget_tests import AbstractWidgetTest
from test.tkinter_test.support import pixels_conv, tcl_version, requires_tcl
from test.tkinter_test.widget_tests import AbstractWidgetTest

requires('gui')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
import tkinter
from test import support
from tkinter.test.support import AbstractTkTest, requires_tcl
from test.tkinter_test.support import AbstractTkTest, requires_tcl

support.requires('gui')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
import tkinter
from test import support
from tkinter.test.support import AbstractTkTest
from test.tkinter_test.support import AbstractTkTest

support.requires('gui')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
import tkinter
from test.support import requires, run_unittest
from tkinter.test.support import AbstractTkTest
from test.tkinter_test.support import AbstractTkTest

requires('gui')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import sys
from test.support import requires

from tkinter.test.support import (tcl_version, requires_tcl,
from test.tkinter_test.support import (tcl_version, requires_tcl,
get_tk_patchlevel, widget_eq)
from tkinter.test.widget_tests import (
from test.tkinter_test.widget_tests import (
add_standard_options, noconv, pixels_round,
AbstractWidgetTest, StandardOptionsTests, IntegerSizeTests, PixelSizeTests,
setUpModule)
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import tkinter
from tkinter import ttk
from test.support import requires, run_unittest, swap_attr
from tkinter.test.support import AbstractTkTest, destroy_default_root
from test.tkinter_test.support import AbstractTkTest, destroy_default_root

requires('gui')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import tkinter
from tkinter import ttk
from test.support import requires, run_unittest
from tkinter.test.support import AbstractTkTest
from test.tkinter_test.support import AbstractTkTest

requires('gui')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from test.support import requires
import sys

from tkinter.test.test_ttk.test_functions import MockTclObj
from tkinter.test.support import (AbstractTkTest, tcl_version, get_tk_patchlevel,
from test.tkinter_test.test_ttk.test_functions import MockTclObj
from test.tkinter_test.support import (AbstractTkTest, tcl_version, get_tk_patchlevel,
simulate_mouse_click)
from tkinter.test.widget_tests import (add_standard_options, noconv,
from test.tkinter_test.widget_tests import (add_standard_options, noconv,
AbstractWidgetTest, StandardOptionsTests, IntegerSizeTests, PixelSizeTests,
setUpModule)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import unittest
import sys
import tkinter
from tkinter.test.support import (AbstractTkTest, tcl_version, requires_tcl,
from test.tkinter_test.support import (AbstractTkTest, tcl_version, requires_tcl,
get_tk_patchlevel, pixels_conv, tcl_obj_eq)
import test.support

Expand Down
4 changes: 2 additions & 2 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -1325,8 +1325,8 @@ maninstall: altmaninstall

# Install the library
XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
tkinter/test/test_ttk site-packages test \
LIBSUBDIRS= tkinter test/tkinter_test test/tkinter_test/test_tkinter \
test/tkinter_test/test_ttk site-packages test \
test/audiodata \
test/capath test/data \
test/cjkencodings test/decimaltestdata \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Moved these class tests: `tkinter.test` to be under `test/tkinter_test`