summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNnarol <lorand.l.juhasz@gmail.com>2023-01-08 13:51:20 (GMT)
committerGitHub <noreply@github.com>2023-01-08 13:51:20 (GMT)
commit0741da8d28790cebe94a4392af37d63b1510080a (patch)
tree2d82f8d83605c596156738920288e81b75ef465a /Lib
parentb034fd3e5926c63a681a211087b4c666834c7525 (diff)
downloadcpython-0741da8d28790cebe94a4392af37d63b1510080a.zip
cpython-0741da8d28790cebe94a4392af37d63b1510080a.tar.gz
cpython-0741da8d28790cebe94a4392af37d63b1510080a.tar.bz2
GH-90829: Fix empty iterable error message in min/max (#31181)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_builtin.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index c656004..9e19af0 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -1155,7 +1155,11 @@ class BuiltinTest(unittest.TestCase):
max()
self.assertRaises(TypeError, max, 42)
- self.assertRaises(ValueError, max, ())
+ with self.assertRaisesRegex(
+ ValueError,
+ r'max\(\) iterable argument is empty'
+ ):
+ max(())
class BadSeq:
def __getitem__(self, index):
raise ValueError
@@ -1214,7 +1218,11 @@ class BuiltinTest(unittest.TestCase):
min()
self.assertRaises(TypeError, min, 42)
- self.assertRaises(ValueError, min, ())
+ with self.assertRaisesRegex(
+ ValueError,
+ r'min\(\) iterable argument is empty'
+ ):
+ min(())
class BadSeq:
def __getitem__(self, index):
raise ValueError