summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_functools.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2017-01-09 15:50:19 (GMT)
committerRaymond Hettinger <python@rcn.com>2017-01-09 15:50:19 (GMT)
commit605a4476f85f97ae274670b56d6d1d750f49cb4c (patch)
tree6a7c36b01b3d91ed5a40e6e2f4d7f50b8a5c1e2f /Lib/test/test_functools.py
parent68191f8a9c90cb538042179ac5a961c8d29eeb07 (diff)
downloadcpython-605a4476f85f97ae274670b56d6d1d750f49cb4c.zip
cpython-605a4476f85f97ae274670b56d6d1d750f49cb4c.tar.gz
cpython-605a4476f85f97ae274670b56d6d1d750f49cb4c.tar.bz2
Add test for ea064ff3c10f
Diffstat (limited to 'Lib/test/test_functools.py')
-rw-r--r--Lib/test/test_functools.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index 9f4899e..eeb3a22 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -1238,6 +1238,15 @@ class TestLRU:
finally:
builtins.len = old_len
+ def test_lru_star_arg_handling(self):
+ # Test regression that arose in ea064ff3c10f
+ @functools.lru_cache()
+ def f(*args):
+ return args
+
+ self.assertEqual(f(1, 2), (1, 2))
+ self.assertEqual(f((1, 2)), ((1, 2),))
+
def test_lru_type_error(self):
# Regression test for issue #28653.
# lru_cache was leaking when one of the arguments