Staging
v0.8.1
Revision 7f554c536cfe2e66a1ff0a36c8896040be1e5aee authored by Miss Islington (bot) on 28 March 2018, 06:43:51 UTC, committed by Ned Deily on 28 March 2018, 07:33:49 UTC
(cherry picked from commit e52ac045972a4f75d7f52e4ee0d6de128259134d)

Co-authored-by: Ned Deily <nad@python.org>
1 parent 3647f85
Raw File
test_ttk_guionly.py
import unittest
from test import support

# Skip this test if _tkinter wasn't built.
support.import_module('_tkinter')

# Skip test if tk cannot be initialized.
support.requires('gui')

import tkinter
from _tkinter import TclError
from tkinter import ttk
from tkinter.test import runtktests

root = None
try:
    root = tkinter.Tk()
    button = ttk.Button(root)
    button.destroy()
    del button
except TclError as msg:
    # assuming ttk is not available
    raise unittest.SkipTest("ttk not available: %s" % msg)
finally:
    if root is not None:
        root.destroy()
    del root

def test_main():
    support.run_unittest(
            *runtktests.get_tests(text=False, packages=['test_ttk']))

if __name__ == '__main__':
    test_main()
back to top