/Lib/lib2to3/tests/test_all_fixers.py

http://unladen-swallow.googlecode.com/ · Python · 35 lines · 18 code · 7 blank · 10 comment · 4 complexity · 1b89e96fcb7c0ff2d9ef4f956297a15b MD5 · raw file

  1. #!/usr/bin/env python2.5
  2. """Tests that run all fixer modules over an input stream.
  3. This has been broken out into its own test module because of its
  4. running time.
  5. """
  6. # Author: Collin Winter
  7. # Testing imports
  8. try:
  9. from . import support
  10. except ImportError:
  11. import support
  12. # Python imports
  13. import unittest
  14. # Local imports
  15. from .. import pytree
  16. from .. import refactor
  17. class Test_all(support.TestCase):
  18. def setUp(self):
  19. options = {"print_function" : False}
  20. self.refactor = support.get_refactorer(options=options)
  21. def test_all_project_files(self):
  22. for filepath in support.all_project_files():
  23. print "Fixing %s..." % filepath
  24. self.refactor.refactor_string(open(filepath).read(), filepath)
  25. if __name__ == "__main__":
  26. import __main__
  27. support.run_all_tests(__main__)