def test_consts_in_conditionals(self):

    def and_true(x):
        return (True and x)

    def and_false(x):
        return (False and x)

    def or_true(x):
        return (True or x)

    def or_false(x):
        return (False or x)
    funcs = [and_true, and_false, or_true, or_false]
    for func in funcs:
        with self.subTest(func=func):
            opcodes = list(dis.get_instructions(func))
            self.assertLessEqual(len(opcodes), 3)
            self.assertIn('LOAD_', opcodes[(- 2)].opname)
            self.assertEqual('RETURN_VALUE', opcodes[(- 1)].opname)
def test_consts_in_conditionals(self):

    def and_true(x):
        return (True and x)

    def and_false(x):
        return (False and x)

    def or_true(x):
        return (True or x)

    def or_false(x):
        return (False or x)
    funcs = [and_true, and_false, or_true, or_false]
    for func in funcs:
        with self.subTest(func=func):
            opcodes = list(dis.get_instructions(func))
            self.assertLessEqual(len(opcodes), 3)
            self.assertIn('LOAD_', opcodes[(- 2)].opname)
            self.assertEqual('RETURN_VALUE', opcodes[(- 1)].opname)