Skip to content

Commit d84cab3

Browse files
cfbolzsobolevn
andauthored
Update Lib/test/test_functools.py
Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent 3d579ea commit d84cab3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/test/test_functools.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,9 +2158,11 @@ def fib(n):
21582158
fib(support.exceeds_recursion_limit())
21592159

21602160
def test_lru_checks_arg_is_callable(self):
2161-
with self.assertRaises(TypeError) as te:
2161+
with self.assertRaisesRegex(
2162+
TypeError,
2163+
"the first argument must be callable",
2164+
):
21622165
self.module.lru_cache(1)('hello')
2163-
self.assertIn("the first argument must be callable", str(te.exception))
21642166

21652167

21662168
@py_functools.lru_cache()

0 commit comments

Comments
 (0)