Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 3
0
 def test_empty_parse(self):
     self.assertEqual(set(), mypy.parse(''))
Ejemplo n.º 4
0
 def test_empty_parse(self):
     self.assertEqual(set(), mypy.parse(''))