Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop module,
[python/dscho.git] / Lib / json / tests / __init__.py
blob1a1e3e6d5a7db84f0ecfd2c7be70ec331d372284
1 import os
2 import sys
3 import unittest
4 import doctest
6 here = os.path.dirname(__file__)
8 def test_suite():
9 suite = additional_tests()
10 loader = unittest.TestLoader()
11 for fn in os.listdir(here):
12 if fn.startswith("test") and fn.endswith(".py"):
13 modname = "json.tests." + fn[:-3]
14 __import__(modname)
15 module = sys.modules[modname]
16 suite.addTests(loader.loadTestsFromModule(module))
17 return suite
19 def additional_tests():
20 import json
21 import json.encoder
22 import json.decoder
23 suite = unittest.TestSuite()
24 for mod in (json, json.encoder, json.decoder):
25 suite.addTest(doctest.DocTestSuite(mod))
26 return suite
28 def main():
29 suite = test_suite()
30 runner = unittest.TextTestRunner()
31 runner.run(suite)
33 if __name__ == '__main__':
34 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
35 main()