Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Lib/test/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2644,7 +2644,7 @@ def test_buffer_api_usage(self):
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:
Expand All @@ -2656,14 +2656,14 @@ def test_text_to_binary_blacklists_binary_transforms(self):
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"
Expand All @@ -2678,7 +2678,7 @@ def test_binary_to_text_blacklists_binary_transforms(self):
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):
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ def close(self):
self.assertIsSubclass(B, Custom)
self.assertNotIsSubclass(A, Custom)

def test_builtin_protocol_whitelist(self):
def test_builtin_protocol_allowlist(self):
with self.assertRaises(TypeError):
class CustomProtocol(TestCase, Protocol):
pass
Expand Down