def test_parse_noqa_with_target_and_argument(self): """Make sure we can target specific args in a noqa.""" node = parse(condense(lex('# noqa: I101 arg1, arg2\n'))) self.assertTrue(CykNodeUtils.contains(node, 'noqa'), str(node))
def test_parse_noqa_with_target(self): """Make sure we can target a specific error message.""" node = parse(condense(lex('# noqa: I203\n'))) self.assertTrue(CykNodeUtils.contains(node, 'noqa'))
def test_parse_line_with_type(self): """Make sure we can parse a line when it starts with a type.""" node = parse(condense(lex(' int: the square of something.\n'))) self.assertTrue(CykNodeUtils.contains(node, 'long-description'))
def test_parse_bare_noqa_statement(self): """Make sure we can parse noqa statements.""" node = parse(condense(lex('# noqa\n'))) self.assertTrue(CykNodeUtils.contains(node, 'noqa'))
def test_parse_yields_short_description_for_first_line_if_possible(self): tokens = condense( lex('\n'.join(['Short description.', '', 'Long description.']))) node = parse(tokens) self.assertTrue(CykNodeUtils.contains(node, 'short-description')) self.assertTrue(CykNodeUtils.contains(node, 'long-description'))