[pywin32-checkins] pywin32/win32/Lib pywin32_testutil.py,1.1,1.2
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2009-01-25 03:12:22
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31323/win32/Lib Modified Files: pywin32_testutil.py Log Message: Add int2long test helper and construct failure objects in py3k-friendly way Index: pywin32_testutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/pywin32_testutil.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pywin32_testutil.py 7 Jan 2009 05:59:56 -0000 1.1 --- pywin32_testutil.py 25 Jan 2009 03:12:18 -0000 1.2 *************** *** 9,12 **** --- 9,16 ---- ## + def int2long(val): + """return a long on py2k""" + return val + 0x100000000 - 0x100000000 + # The test suite has lots of string constants containing binary data, but # the strings are used in various "bytes" contexts. *************** *** 82,86 **** msg = "%d interface objects and %d gateway objects leaked" \ % (lost_i, lost_g) ! result.addFailure(self.real_test, (AssertionError, msg, None)) def runTest(self): --- 86,91 ---- msg = "%d interface objects and %d gateway objects leaked" \ % (lost_i, lost_g) ! exc = AssertionError(msg) ! result.addFailure(self.real_test, (exc.__class__, exc, None)) def runTest(self): *************** *** 109,113 **** if lost > 0: msg = "LeakTest: %s lost %d references" % (self.real_test, lost) ! result.addFailure(self.real_test, (AssertionError, msg, None)) --- 114,119 ---- if lost > 0: msg = "LeakTest: %s lost %d references" % (self.real_test, lost) ! exc = AssertionError(msg) ! result.addFailure(self.real_test, (exc.__class__, exc, None)) |