How to use the retype._type_comment_re function in retype

To help you get started, we’ve selected a few retype 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 ambv / retype / tests / test_retype.py View on Github external
def assertNoMatch(self, input: str) -> None:
        m = _type_comment_re.match(input)
        self.assertIsNone(m)
github ambv / retype / tests / test_retype.py View on Github external
def assertMatch(self, input: str, *, type: str, nl: str) -> None:
        m = _type_comment_re.match(input)
        self.assertIsNotNone(m)
        if m is not None:
            self.assertEqual(m.group("type"), type)
            self.assertEqual(m.group("nl"), nl)