Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Simplify the altchars strategy
  • Loading branch information
encukou committed May 22, 2024
commit b28b80a04b78f1399c37e032f8dd8fa59465d81a
4 changes: 2 additions & 2 deletions Lib/test/test_base64.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def altchars(draw):
reserved_chars = (string.digits + string.ascii_letters + "=").encode()
allowed_chars = hypothesis.strategies.sampled_from(
[n for n in range(256) if n not in reserved_chars])
return bytes(draw(hypothesis.strategies.lists(allowed_chars, min_size=2,
max_size=2, unique=True)))
return hypothesis.strategies.lists(
allowed_chars, min_size=2, max_size=2, unique=True).map(bytes)

class LegacyBase64TestCase(unittest.TestCase):

Expand Down