diff options
author | Collin Winter <collinw@gmail.com> | 2010-03-17 17:36:16 (GMT) |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2010-03-17 17:36:16 (GMT) |
commit | 786431282b892c180cddcb6c52ef5d1c06f526fe (patch) | |
tree | 1e36970f864162e475c73ff848cb5cc69b214eba /Lib/ctypes | |
parent | 2060e42206d12900a0875d7b31ecc9f99ff9e16c (diff) | |
download | cpython-786431282b892c180cddcb6c52ef5d1c06f526fe.zip cpython-786431282b892c180cddcb6c52ef5d1c06f526fe.tar.gz cpython-786431282b892c180cddcb6c52ef5d1c06f526fe.tar.bz2 |
Avoid hardcoding refcounts in tests.
Diffstat (limited to 'Lib/ctypes')
-rw-r--r-- | Lib/ctypes/test/test_internals.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/ctypes/test/test_internals.py b/Lib/ctypes/test/test_internals.py index 2f94670..2e5b1fe 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): |