[pywin32-checkins] pywin32/win32/test test_exceptions.py,1.3,1.4
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-10-02 12:10:04
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16045/win32/test Modified Files: test_exceptions.py Log Message: various py3k compatible syntax modernizations merged from py3k branch; unnecessary 'L' suffixes, raise exceptions as objects, types module, etc Index: test_exceptions.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_exceptions.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_exceptions.py 1 Oct 2008 06:49:31 -0000 1.3 --- test_exceptions.py 2 Oct 2008 12:09:53 -0000 1.4 *************** *** 7,12 **** class TestBase(unittest.TestCase): def _testExceptionIndex(self, exc, index, expected): ! # check the exception itself can be indexed. ! self.failUnlessEqual(exc[index], expected) # and that exception.args can is the same. self.failUnlessEqual(exc.args[index], expected) --- 7,13 ---- class TestBase(unittest.TestCase): def _testExceptionIndex(self, exc, index, expected): ! # check the exception itself can be indexed if not py3k ! if sys.version_info < (3,): ! self.failUnlessEqual(exc[index], expected) # and that exception.args can is the same. self.failUnlessEqual(exc.args[index], expected) *************** *** 58,62 **** # early on the result actually *was* a tuple - it must be able to be one err_tuple = (winerror.ERROR_INVALID_HANDLE, 'CloseHandle', err_msg) ! self.failUnlessEqual(tuple(exc), err_tuple) def testClassName(self): --- 59,66 ---- # early on the result actually *was* a tuple - it must be able to be one err_tuple = (winerror.ERROR_INVALID_HANDLE, 'CloseHandle', err_msg) ! if sys.version_info < (3,): ! self.failUnlessEqual(tuple(exc), err_tuple) ! else: ! self.failUnlessEqual(exc.args, err_tuple) def testClassName(self): *************** *** 114,118 **** # early on the result actually *was* a tuple - it must be able to be one err_tuple = (winerror.STG_E_INVALIDFLAG, err_msg, None, None) ! self.failUnlessEqual(tuple(exc), err_tuple) def testClassName(self): --- 118,125 ---- # early on the result actually *was* a tuple - it must be able to be one err_tuple = (winerror.STG_E_INVALIDFLAG, err_msg, None, None) ! if sys.version_info < (3,): ! self.failUnlessEqual(tuple(exc), err_tuple) ! else: ! self.failUnlessEqual(exc.args, err_tuple) def testClassName(self): |