from pychecker2 import TestSupport
from pychecker2 import OpChecks

class OpTests(TestSupport.WarningTester):
    def testOperator(self):
        for op in ['--', '++']:
            self.warning('def f(x):\n'
                         '   return %sx' % op,
                         2, OpChecks.OpCheck.operator, op)
            
    def testOperatorPlus(self):
        self.warning('def f(x):\n'
                     '   return +x', 2, OpChecks.OpCheck.operatorPlus)

@@ -459,8 +459,700 @@
 orPlus)%0A
+%0A    def testExcept(self):%0A        self.warning('try:%5Cn'%0A                     '   pass%5Cn'%0A                     'except:%5Cn'%0A                     '   pass%5Cn', 4, OpChecks.ExceptCheck.emptyExcept)%0A        self.warning('try:%5Cn'%0A                     '   pass%5Cn'%0A                     'except AssertionError:%5Cn'%5C%0A                     '   pass%5Cn'%0A                     'except:%5Cn'%0A                     '   pass%5Cn', 6, OpChecks.ExceptCheck.emptyExcept)%0A        self.warning('try:%5Cn'%0A                     '   pass%5Cn'%0A                     'except:%5Cn'%0A                     '   pass%5Cn'%0A                     'except AssertionError:%5Cn'%5C%0A                     '   pass%5Cn', 4, OpChecks.ExceptCheck.emptyExcept)%0A

test empty exceptions