summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_weakref.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-06-05 15:22:31 (GMT)
committerGitHub <noreply@github.com>2019-06-05 15:22:31 (GMT)
commit142566c028720934325f0b7fe28680afd046e00f (patch)
tree021875972731bf9271bf07cc05d17f15866ded7a /Lib/test/test_weakref.py
parent6c01ebcc0dfc6be22950fabb46bdc10dcb6202c9 (diff)
downloadcpython-142566c028720934325f0b7fe28680afd046e00f.zip
cpython-142566c028720934325f0b7fe28680afd046e00f.tar.gz
cpython-142566c028720934325f0b7fe28680afd046e00f.tar.bz2
[3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620)
Turn deprecation warnings added in 3.8 into TypeError.
Diffstat (limited to 'Lib/test/test_weakref.py')
-rw-r--r--Lib/test/test_weakref.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 6f15c03..ce5bbfc 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -1866,20 +1866,10 @@ class FinalizeTestCase(unittest.TestCase):
f()
self.assertEqual(res, [((1, 2), {'func': 3, 'obj': 4})])
- res = []
- with self.assertWarns(DeprecationWarning):
- f = weakref.finalize(a, func=fin, arg=1)
- self.assertEqual(f.peek(), (a, fin, (), {'arg': 1}))
- f()
- self.assertEqual(res, [((), {'arg': 1})])
-
- res = []
- with self.assertWarns(DeprecationWarning):
- f = weakref.finalize(obj=a, func=fin, arg=1)
- self.assertEqual(f.peek(), (a, fin, (), {'arg': 1}))
- f()
- self.assertEqual(res, [((), {'arg': 1})])
-
+ with self.assertRaises(TypeError):
+ weakref.finalize(a, func=fin, arg=1)
+ with self.assertRaises(TypeError):
+ weakref.finalize(obj=a, func=fin, arg=1)
self.assertRaises(TypeError, weakref.finalize, a)
self.assertRaises(TypeError, weakref.finalize)