summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_codecs.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-08-11 13:28:43 (GMT)
committerGitHub <noreply@github.com>2020-08-11 13:28:43 (GMT)
commit0ee0b2938cb606151d8d287472c838044bad4a0e (patch)
treeda94aff53ccc3eeb060312ef925394b2e0ab4936 /Lib/test/test_codecs.py
parentfabd7bb8e0450f16ed5c5c0ad575aa413d65712d (diff)
downloadcpython-0ee0b2938cb606151d8d287472c838044bad4a0e.zip
cpython-0ee0b2938cb606151d8d287472c838044bad4a0e.tar.gz
cpython-0ee0b2938cb606151d8d287472c838044bad4a0e.tar.bz2
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21823)
Rename 5 test method names in test_codecs and test_typing.
Diffstat (limited to 'Lib/test/test_codecs.py')
-rw-r--r--Lib/test/test_codecs.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index f0da35c..3dd5682 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -2644,7 +2644,7 @@ class TransformCodecTest(unittest.TestCase):
view_decoded = codecs.decode(view, encoding)
self.assertEqual(view_decoded, data)
- def test_text_to_binary_blacklists_binary_transforms(self):
+ def test_text_to_binary_denylists_binary_transforms(self):
# Check binary -> binary codecs give a good error for str input
bad_input = "bad input type"
for encoding in bytes_transform_encodings:
@@ -2656,14 +2656,14 @@ class TransformCodecTest(unittest.TestCase):
bad_input.encode(encoding)
self.assertIsNone(failure.exception.__cause__)
- def test_text_to_binary_blacklists_text_transforms(self):
+ def test_text_to_binary_denylists_text_transforms(self):
# Check str.encode gives a good error message for str -> str codecs
msg = (r"^'rot_13' is not a text encoding; "
r"use codecs.encode\(\) to handle arbitrary codecs")
with self.assertRaisesRegex(LookupError, msg):
"just an example message".encode("rot_13")
- def test_binary_to_text_blacklists_binary_transforms(self):
+ def test_binary_to_text_denylists_binary_transforms(self):
# Check bytes.decode and bytearray.decode give a good error
# message for binary -> binary codecs
data = b"encode first to ensure we meet any format restrictions"
@@ -2678,7 +2678,7 @@ class TransformCodecTest(unittest.TestCase):
with self.assertRaisesRegex(LookupError, msg):
bytearray(encoded_data).decode(encoding)
- def test_binary_to_text_blacklists_text_transforms(self):
+ def test_binary_to_text_denylists_text_transforms(self):
# Check str -> str codec gives a good error for binary input
for bad_input in (b"immutable", bytearray(b"mutable")):
with self.subTest(bad_input=bad_input):