def hacking_assert_greater_less(logical_line, noqa):
    r"""Check that self.assert{Greater,Less}[Equal] are used.

    Okay: self.assertGreater(x, y)
    Okay: self.assertGreaterEqual(x, y)
    Okay: self.assertLess(x, y)
    Okay: self.assertLessEqual(x, y)
    H205: self.assertTrue(x > y)
    H205: self.assertTrue(x >= y)
    H205: self.assertTrue(x < y)
    H205: self.assertTrue(x <= y)
    """
    if noqa:
        return

    methods = ['assertTrue', 'assertFalse']
    for method in methods:
        start = logical_line.find('.%s' % method) + 1
        if start != 0:
            break
    else:
        return
    comparisons = [ast.Gt, ast.GtE, ast.Lt, ast.LtE]
    checker = AssertTrueFalseChecker(methods, comparisons)
    checker.visit(ast.parse(logical_line))
    if checker.error:
        yield start, 'H205: Use assert{Greater,Less}[Equal]'
def hacking_assert_greater_less ( logical_line , noqa ) : if noqa : return methods = [ 'assertTrue' , 'assertFalse' ] for method in methods : start = logical_line . find ( '.%s' % method ) + 1 if start != 0 : break else : return comparisons = [ ast . Gt , ast . GtE , ast . Lt , ast . LtE ] checker = AssertTrueFalseChecker ( methods , comparisons ) checker . visit ( ast . parse ( logical_line ) ) if checker . error : yield start , 'H205: Use assert{Greater,Less}[Equal]'
r"""Check that self.assert{Greater,Less}[Equal] are used.

    Okay: self.assertGreater(x, y)
    Okay: self.assertGreaterEqual(x, y)
    Okay: self.assertLess(x, y)
    Okay: self.assertLessEqual(x, y)
    H205: self.assertTrue(x > y)
    H205: self.assertTrue(x >= y)
    H205: self.assertTrue(x < y)
    H205: self.assertTrue(x <= y)