from _tkinter import TclError
from tkinter import ttk
from tkinter.test import runtktests
+from tkinter.test.support import get_tk_root
try:
ttk.Button()
elif 'gui' not in support.use_resources:
support.use_resources.append('gui')
- support.run_unittest(
- *runtktests.get_tests(text=False, packages=['test_ttk']))
+ try:
+ support.run_unittest(
+ *runtktests.get_tests(text=False, packages=['test_ttk']))
+ finally:
+ get_tk_root().destroy()
if __name__ == '__main__':
test_main(enable_gui=True)