summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_weakref.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_weakref.py')
-rw-r--r--Lib/test/test_weakref.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 34831f1..d42922a 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -249,6 +249,10 @@ class ReferencesTestCase(TestBase):
self.assert_(weakref.getweakrefcount(o) == 4,
"got wrong number of weak reference objects")
+ # assumes ints do not support weakrefs
+ self.assert_(weakref.getweakrefcount(1) == 0,
+ "got wrong number of weak reference objects for int")
+
def test_getweakrefs(self):
o = C()
ref1 = weakref.ref(o, self.callback)
@@ -264,6 +268,10 @@ class ReferencesTestCase(TestBase):
self.assert_(weakref.getweakrefs(o) == [ref1],
"list of refs does not match")
+ # assumes ints do not support weakrefs
+ self.assert_(weakref.getweakrefs(1) == [],
+ "list of refs does not match for int")
+
def test_newstyle_number_ops(self):
class F(float):
pass