How to use the betelgeuse.parser.parse_docstring function in Betelgeuse

To help you get started, we’ve selected a few Betelgeuse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SatelliteQE / betelgeuse / tests / test_parser.py View on Github external
def test_parse_none_docstring(docstring):
    """Check ``parse_docstring`` returns empty dict on empty input."""
    assert parser.parse_docstring(docstring) == {}
github SatelliteQE / betelgeuse / tests / test_parser.py View on Github external
def test_parse_docstring_special_characters():
    """Check ``parse_docstring`` parser result."""
    docstring = """
    Description with an special character like é

    :field1: value with an special character like é
    """
    assert parser.parse_docstring(docstring) == {
        u'field1': u'value with an special character like é',
    }
github SatelliteQE / betelgeuse / betelgeuse / collector.py View on Github external
return

        # Parse package, module, class and function docstrings. Every loop
        # updates the already defined fields. The order of processing ensures
        # that function docstring has more priority over class and module and
        # package docstrings respectively.
        docstrings = [
            self.pkginit_docstring,
            self.module_docstring,
            self.class_docstring,
            self.docstring,
        ]
        for docstring in docstrings:
            if docstring and not isinstance(docstring, type(u'')):
                docstring = docstring.decode('utf-8')
            self.fields.update(parse_docstring(docstring))