summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tk.py
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2014-05-02 15:33:49 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2014-05-02 15:33:49 (GMT)
commit2460dc880f9d8df0ddbc77790dfd68767e481527 (patch)
treeda74cd5b2590e8ac5e35f5ab1755a54f4c03a8c8 /Lib/test/test_tk.py
parente9864c5e30f574f599d9c27e5907d1d541ec6e4b (diff)
downloadcpython-2460dc880f9d8df0ddbc77790dfd68767e481527.zip
cpython-2460dc880f9d8df0ddbc77790dfd68767e481527.tar.gz
cpython-2460dc880f9d8df0ddbc77790dfd68767e481527.tar.bz2
Issue #18604: Consolidated checks for GUI availability.
test_support._is_gui_available is now defined the same way on every platform, and now includes the Windows-specific check that had been in the Windows version of _is_gui_available and the OSX-specific check that was in runtktests.check_tk_availability. Also, every platform checks whether Tk can be instantiated (if the platform-specific checks passed).
Diffstat (limited to 'Lib/test/test_tk.py')
-rw-r--r--Lib/test/test_tk.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/test/test_tk.py b/Lib/test/test_tk.py
index 8625db2..56eef47 100644
--- a/Lib/test/test_tk.py
+++ b/Lib/test/test_tk.py
@@ -1,8 +1,9 @@
import os
from test import test_support
-# Skip test if _tkinter wasn't built.
+# Skip test if _tkinter wasn't built or gui resource is not available.
test_support.import_module('_tkinter')
+test_support.requires('gui')
this_dir = os.path.dirname(os.path.abspath(__file__))
lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir,
@@ -11,9 +12,6 @@ lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir,
with test_support.DirsOnSysPath(lib_tk_test):
import runtktests
-# Skip test if tk cannot be initialized.
-runtktests.check_tk_availability()
-
def test_main(enable_gui=False):
if enable_gui:
if test_support.use_resources is None: