Beispiel #1
0
    def __init__(self, tests=()):
        unittest.TestSuite.__init__(self, tests)

        if sys.argv[0] == 'setup.py':
            argv = sys.argv[2:]
        else:
            argv = sys.argv[1:]

        flags.FLAGS(['test'] + argv)

        if argv:
            test_files = argv
        else:
            test_files = os.listdir(
                os.path.join(
                    os.path.dirname(runner.__file__),
                    'testdata',
                ))
            excepted = [
                'bugs.js',  # Not implemented - known bugs.
                'not_strict.js',  # Don't know what to expect for non-strict.
                'file_level_comment.js',  # Not implemented.
            ]
            test_files = [t for t in test_files if t not in excepted]

        for test_file in test_files:
            resource_path = os.path.join(_RESOURCE_PREFIX, test_file)
            self.addTest(
                filetestcase.AnnotatedFileTestCase(resource_path, runner.Run,
                                                   errors.ByName))
Beispiel #2
0
    def __init__(self, tests=()):
        unittest.TestSuite.__init__(self, tests)

        argv = sys.argv and sys.argv[1:] or []
        if argv:
            test_files = argv
        else:
            test_files = _TEST_FILES
        for test_file in test_files:
            resource_path = os.path.join(_RESOURCE_PREFIX, test_file)
            self.addTest(
                filetestcase.AnnotatedFileTestCase(resource_path, runner.Run,
                                                   errors.ByName))