Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Side by Side Diff: Lib/test/test_tk.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_time.py ('k') | Lib/test/test_tokenize.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 from test import support 1 from test import support
2 # Skip test if _tkinter wasn't built. 2 # Skip test if _tkinter wasn't built.
3 support.import_module('_tkinter') 3 support.import_module('_tkinter')
4 4
5 # Skip test if tk cannot be initialized. 5 import tkinter
6 from tkinter.test.support import check_tk_availability 6 from tkinter.test import runtktests
7 check_tk_availability() 7 import unittest
8 8
9 from tkinter.test import runtktests 9 try:
10 tkinter.Button()
11 except tkinter.TclError as msg:
12 # assuming tk is not available
13 raise unittest.SkipTest("tk not available: %s" % msg)
10 14
11 def test_main(enable_gui=False): 15 def test_main(enable_gui=False):
12 if enable_gui: 16 if enable_gui:
13 if support.use_resources is None: 17 if support.use_resources is None:
14 support.use_resources = ['gui'] 18 support.use_resources = ['gui']
15 elif 'gui' not in support.use_resources: 19 elif 'gui' not in support.use_resources:
16 support.use_resources.append('gui') 20 support.use_resources.append('gui')
17 21
18 support.run_unittest( 22 support.run_unittest(
19 *runtktests.get_tests(text=False, packages=['test_tkinter'])) 23 *runtktests.get_tests(text=False, packages=['test_tkinter']))
20 24
21 if __name__ == '__main__': 25 if __name__ == '__main__':
22 test_main(enable_gui=True) 26 test_main(enable_gui=True)
OLDNEW
« no previous file with comments | « Lib/test/test_time.py ('k') | Lib/test/test_tokenize.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+