From 59a62aa7e26fe85ae9e2efdf1fb8cee8b05620bb Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Thu, 24 Jul 2025 10:34:26 +0200 Subject: [PATCH] Increase coverage --- Lib/test/test_codecs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index 9b64888b082..f4d0f8d9ad3 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -3130,15 +3130,18 @@ def test_uu_invalid(self): def test_invalid_error_input(self): # decoders/encoders require errors == 'strict' - for encoding in bytes_transform_encodings: - with self.subTest(encoding=encoding): + with (self.subTest(encoding=encoding)): encoder = codecs.getencoder(encoding) decoder = codecs.getdecoder(encoding) self.assertRaises(ValueError, encoder, 'in', errors='notstrict') self.assertRaises(ValueError, decoder, 'in', errors='notstrict') + incdev = codecs.getincrementaldecoder(encoding) + if encoding not in ('base64_codec', 'uu_codec', 'quopri_codec', 'hex_codec'): + self.assertRaises(ValueError, incdev, errors='notstrict') + # The codec system tries to add notes to exceptions in order to ensure