From: Collin Winter Date: Wed, 17 Mar 2010 17:36:16 +0000 (+0000) Subject: Avoid hardcoding refcounts in tests. X-Git-Tag: v2.7b1~336 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=786431282b892c180cddcb6c52ef5d1c06f526fe;p=python Avoid hardcoding refcounts in tests. --- diff --git a/Lib/ctypes/test/test_internals.py b/Lib/ctypes/test/test_internals.py index 2f94670b80..2e5b1fed45 100644 --- a/Lib/ctypes/test/test_internals.py +++ b/Lib/ctypes/test/test_internals.py @@ -23,16 +23,16 @@ class ObjectsTestCase(unittest.TestCase): def test_ints(self): i = 42000123 - self.assertEqual(3, grc(i)) + refcnt = grc(i) ci = c_int(i) - self.assertEqual(3, grc(i)) + self.assertEqual(refcnt, grc(i)) self.assertEqual(ci._objects, None) def test_c_char_p(self): s = "Hello, World" - self.assertEqual(3, grc(s)) + refcnt = grc(s) cs = c_char_p(s) - self.assertEqual(4, grc(s)) + self.assertEqual(refcnt + 1, grc(s)) self.assertSame(cs._objects, s) def test_simple_struct(self):