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

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

Issue 19990: Add unittests for imghdr module
Patch Set: Created 5 years, 10 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
« Lib/test/test_imghdr.py ('K') | « Lib/test/test_imghdr.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """Do a minimal test of all the modules that aren't otherwise tested.""" 1 """Do a minimal test of all the modules that aren't otherwise tested."""
2 import importlib 2 import importlib
3 import sys 3 import sys
4 from test import support 4 from test import support
5 import unittest 5 import unittest
6 6
7 class TestUntestedModules(unittest.TestCase): 7 class TestUntestedModules(unittest.TestCase):
8 def test_untested_modules_can_be_imported(self): 8 def test_untested_modules_can_be_imported(self):
9 untested = ('bdb', 'encodings', 'formatter', 'imghdr', 9 untested = ('bdb', 'encodings', 'formatter',
10 'nturl2path', 'tabnanny') 10 'nturl2path', 'tabnanny')
11 with support.check_warnings(quiet=True): 11 with support.check_warnings(quiet=True):
12 for name in untested: 12 for name in untested:
13 try: 13 try:
14 support.import_module('test.test_{}'.format(name)) 14 support.import_module('test.test_{}'.format(name))
15 except unittest.SkipTest: 15 except unittest.SkipTest:
16 importlib.import_module(name) 16 importlib.import_module(name)
17 else: 17 else:
18 self.fail('{} has tests even though test_sundry claims ' 18 self.fail('{} has tests even though test_sundry claims '
19 'otherwise'.format(name)) 19 'otherwise'.format(name))
(...skipping 30 matching lines...) Expand all
50 50
51 try: 51 try:
52 import tty # Not available on Windows 52 import tty # Not available on Windows
53 except ImportError: 53 except ImportError:
54 if support.verbose: 54 if support.verbose:
55 print("skipping tty") 55 print("skipping tty")
56 56
57 57
58 if __name__ == "__main__": 58 if __name__ == "__main__":
59 unittest.main() 59 unittest.main()
OLDNEW
« Lib/test/test_imghdr.py ('K') | « Lib/test/test_imghdr.py ('k') | no next file » | no next file with comments »

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