summaryrefslogtreecommitdiff
path: root/Lib/test/test_functools.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2014-08-12 12:44:52 -0700
committerRaymond Hettinger <python@rcn.com>2014-08-12 12:44:52 -0700
commit4d58897fdb0f123340246fac79174a52d7cbcf85 (patch)
tree312b779808cbfe4b8ce9d9a9e142e0ccb778cca5 /Lib/test/test_functools.py
parent4d83192ea05f5c14534edbff2b3a74bb19f01068 (diff)
downloadcpython-git-4d58897fdb0f123340246fac79174a52d7cbcf85.tar.gz
Issue 22184: Early detection and reporting of missing lru_cache parameters
Diffstat (limited to 'Lib/test/test_functools.py')
-rw-r--r--Lib/test/test_functools.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index 75ae7f3a15..a7e5c7e3ef 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -1070,6 +1070,13 @@ class TestLRU(unittest.TestCase):
self.assertEqual(test_func(DoubleEq(2)), # Trigger a re-entrant __eq__ call
DoubleEq(2)) # Verify the correct return value
+ def test_early_detection_of_bad_call(self):
+ # Issue #22184
+ with self.assertRaises(TypeError):
+ @functools.lru_cache
+ def f():
+ pass
+
class TestSingleDispatch(unittest.TestCase):
def test_simple_overloads(self):