@@ -0,0 +1,1027 @@
+from pychecker2.TestSupport import WarningTester%0Afrom pychecker2 import ConditionalChecks%0A%0Aclass ClassTestCase(WarningTester):%0A    def testConstants(self):%0A        w = ConditionalChecks.ConstantCheck.constantInConditional%0A        %0A        self.silent('a, b = 1, 2%5Cn'%0A                    'if a %3C b:%5Cn'%0A                    '   print a%5Cn')%0A        self.warning('a = 1%5Cn'%0A                     'if a or 1:%5Cn'%0A                     '  print a%5Cn', 2, w, '1')%0A        self.warning('a = 1%5Cn'%0A                     'if not 1:%5Cn'%0A                     '  print a%5Cn', 2, w, '1')%0A        self.silent('a, b = 1, 2%5Cn'%0A                    'if a %3C 1 + 7:%5Cn'%0A                    '   print a%5Cn')%0A        self.warning('result = %5Bx for x in %5B1, 2, 3%5D if x or 1%5D%5Cn',%0A                     1, w, '1')%0A        self.warning('result = %5Bx for x in %5B1, 2, 3%5D if x or None%5D%5Cn',%0A                     1, w, 'None')%0A        self.warning('x = 1%5Cn'%0A                     'while x or None:%5Cn'%0A                     '   x = x + 1%5Cn',%0A                     2, w, 'None')%0A

test constant in conditionals