示例#1
0
    def test_parse_errors(self):
        test_string = '''
src/linters/pylint.py: note: expected 2 blank lines, found 1
tests/linters/pylint.py:42: error: "module" has no attribute "foo"
tests/linters/pylint.py:33: error: "module" has no attribute "bar"
'''

        result = mypy.parse(test_string)
        self.assertEqual(2, len(result))
        self.assertIn(
            Problem('tests/linters/pylint.py', 42,
                    'error: "module" has no attribute "foo"'), result)

        self.assertIn(
            Problem('tests/linters/pylint.py', 33,
                    'error: "module" has no attribute "bar"'), result)
示例#2
0
    def test_parse_errors(self):
        test_string = '''
src/linters/pylint.py: note: expected 2 blank lines, found 1
tests/linters/pylint.py:42: error: "module" has no attribute "foo"
tests/linters/pylint.py:33: error: "module" has no attribute "bar"
'''

        result = mypy.parse(test_string)
        self.assertEqual(2, len(result))
        self.assertIn(Problem('tests/linters/pylint.py',
                              42,
                              'error: "module" has no attribute "foo"'),
                      result)

        self.assertIn(Problem('tests/linters/pylint.py',
                              33,
                              'error: "module" has no attribute "bar"'),
                      result)
示例#3
0
 def test_empty_parse(self):
     self.assertEqual(set(), mypy.parse(''))
示例#4
0
 def test_empty_parse(self):
     self.assertEqual(set(), mypy.parse(''))