[Python-3000-checkins] r59476 - python/branches/py3k/Lib/ctypes/test/test_values.py

thomas.heller python-3000-checkins at python.org
Wed Dec 12 21:01:44 CET 2007


Author: thomas.heller
Date: Wed Dec 12 21:01:44 2007
New Revision: 59476

Modified:
   python/branches/py3k/Lib/ctypes/test/test_values.py
Log:
Add a comment to explain why we have to restore the original value.


Modified: python/branches/py3k/Lib/ctypes/test/test_values.py
==============================================================================
--- python/branches/py3k/Lib/ctypes/test/test_values.py	(original)
+++ python/branches/py3k/Lib/ctypes/test/test_values.py	Wed Dec 12 21:01:44 2007
@@ -10,12 +10,16 @@
 class ValuesTestCase(unittest.TestCase):
 
     def test_an_integer(self):
+        # This test checks and changes an integer stored inside the
+        # _ctypes_test dll/shared lib.
         ctdll = CDLL(_ctypes_test.__file__)
         an_integer = c_int.in_dll(ctdll, "an_integer")
         x = an_integer.value
         self.failUnlessEqual(x, ctdll.get_an_integer())
         an_integer.value *= 2
         self.failUnlessEqual(x*2, ctdll.get_an_integer())
+        # To avoid test failures when this test is repeated several
+        # times the original value must be restored
         an_integer.value = x
         self.failUnlessEqual(x, ctdll.get_an_integer())
 


More information about the Python-3000-checkins mailing list