PageRenderTime 15ms CodeModel.GetById 7ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/Lib/lib2to3/tests/test_all_fixers.py

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