Exemplo n.º 1
0
    def test_func_with_raise(self) -> None:
        parser = GoogleParser()
        doc = pydoc.getdoc(tests.test_class.raises_class.RaisesClass.func_with_raise)
        actual_exceptions = parser.get_exceptions_raised(doc)
        expected_exceptions = [ 'RuntimeError', 'ValueError', 'IndexError' ]
        assert len(expected_exceptions) == len(actual_exceptions)

        intersection = set(expected_exceptions) - set(actual_exceptions)
        assert len(intersection) == 0
Exemplo n.º 2
0
 def test_get_exceptions_raised(self) -> None:
     parser = GoogleParser()
     doc = pydoc.getdoc(tests.test_class.incorrect_class.IncorrectTestClass.func_parse_exception)
     with pytest.raises(ParseException) as exc_info:
         parser.get_exceptions_raised(doc)