Skip to content

Commit 0ee0b29

Browse files
authored
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21823)
Rename 5 test method names in test_codecs and test_typing.
1 parent fabd7bb commit 0ee0b29

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Lib/test/test_codecs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2644,7 +2644,7 @@ def test_buffer_api_usage(self):
26442644
view_decoded = codecs.decode(view, encoding)
26452645
self.assertEqual(view_decoded, data)
26462646

2647-
def test_text_to_binary_blacklists_binary_transforms(self):
2647+
def test_text_to_binary_denylists_binary_transforms(self):
26482648
# Check binary -> binary codecs give a good error for str input
26492649
bad_input = "bad input type"
26502650
for encoding in bytes_transform_encodings:
@@ -2656,14 +2656,14 @@ def test_text_to_binary_blacklists_binary_transforms(self):
26562656
bad_input.encode(encoding)
26572657
self.assertIsNone(failure.exception.__cause__)
26582658

2659-
def test_text_to_binary_blacklists_text_transforms(self):
2659+
def test_text_to_binary_denylists_text_transforms(self):
26602660
# Check str.encode gives a good error message for str -> str codecs
26612661
msg = (r"^'rot_13' is not a text encoding; "
26622662
r"use codecs.encode\(\) to handle arbitrary codecs")
26632663
with self.assertRaisesRegex(LookupError, msg):
26642664
"just an example message".encode("rot_13")
26652665

2666-
def test_binary_to_text_blacklists_binary_transforms(self):
2666+
def test_binary_to_text_denylists_binary_transforms(self):
26672667
# Check bytes.decode and bytearray.decode give a good error
26682668
# message for binary -> binary codecs
26692669
data = b"encode first to ensure we meet any format restrictions"
@@ -2678,7 +2678,7 @@ def test_binary_to_text_blacklists_binary_transforms(self):
26782678
with self.assertRaisesRegex(LookupError, msg):
26792679
bytearray(encoded_data).decode(encoding)
26802680

2681-
def test_binary_to_text_blacklists_text_transforms(self):
2681+
def test_binary_to_text_denylists_text_transforms(self):
26822682
# Check str -> str codec gives a good error for binary input
26832683
for bad_input in (b"immutable", bytearray(b"mutable")):
26842684
with self.subTest(bad_input=bad_input):

Lib/test/test_typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ def close(self):
13871387
self.assertIsSubclass(B, Custom)
13881388
self.assertNotIsSubclass(A, Custom)
13891389

1390-
def test_builtin_protocol_whitelist(self):
1390+
def test_builtin_protocol_allowlist(self):
13911391
with self.assertRaises(TypeError):
13921392
class CustomProtocol(TestCase, Protocol):
13931393
pass

0 commit comments

Comments
 (0)