summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_weakref.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-07 12:41:09 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-07 12:41:09 (GMT)
commit21eb48764c618eede0405ef840eadf1b03ff9b00 (patch)
tree74014667fe8b77408970089321c055ac10369fa9 /Lib/test/test_weakref.py
parent6dff0205b724669cc0469dd65a3f7edc5a69e1e7 (diff)
downloadcpython-21eb48764c618eede0405ef840eadf1b03ff9b00.zip
cpython-21eb48764c618eede0405ef840eadf1b03ff9b00.tar.gz
cpython-21eb48764c618eede0405ef840eadf1b03ff9b00.tar.bz2
Issue #17765: weakref.ref() no longer silently ignores keyword arguments.
Patch by Georg Brandl.
Diffstat (limited to 'Lib/test/test_weakref.py')
-rw-r--r--Lib/test/test_weakref.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index f37f1e9..f49cb7e 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -133,6 +133,10 @@ class ReferencesTestCase(TestBase):
ref1 = weakref.ref(c, callback)
del c
+ def test_constructor_kwargs(self):
+ c = C()
+ self.assertRaises(TypeError, weakref.ref, c, callback=None)
+
def test_proxy_ref(self):
o = C()
o.bar = 1