/Lib/test/test_lib2to3.py

http://unladen-swallow.googlecode.com/ · Python · 24 lines · 18 code · 4 blank · 2 comment · 3 complexity · 0e5924f977d539cfdec4beeebb592a7a MD5 · raw file

  1. # Skipping test_parser and test_all_fixers
  2. # because of running
  3. from lib2to3.tests import test_fixers, test_pytree, test_util, test_refactor
  4. import sys
  5. from test.test_support import run_unittest
  6. import unittest
  7. def suite():
  8. tests = unittest.TestSuite()
  9. loader = unittest.TestLoader()
  10. for m in (test_fixers,test_pytree,test_util, test_refactor):
  11. tests.addTests(loader.loadTestsFromModule(m))
  12. return tests
  13. def test_main():
  14. run_unittest(suite())
  15. if __name__ == '__main__':
  16. if sys.flags.optimize >= 2:
  17. print >>sys.stderr, "test_lib2to3 --",
  18. print >>sys.stderr, "skipping some tests due to -O flag."
  19. sys.stderr.flush()
  20. test_main()