Skip to content

Commit

Permalink
fixup! BUG: encode_pdfdocencoding() always returns bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
sbourlon committed Feb 7, 2024
1 parent b897b91 commit 404c0f6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,14 @@ def test_encode_pdfdocencoding_keyerror():
assert exc.value.args[0] == "pdfdocencoding"


def test_encode_pdfdocencoding_returns_bytes():
@pytest.mark.parametrize("test_input", ["", "data"])
def test_encode_pdfdocencoding_returns_bytes(test_input):
"""
Test that encode_pdfdocencoding() always returns bytes because bytearray
is duck type compatible with bytes in mypy
"""
inputs = ["", "data"]
for _input in inputs:
# test_input = ["", "data"]
for _input in test_input:
out = encode_pdfdocencoding(_input)
assert isinstance(out, bytes)

Expand Down

0 comments on commit 404c0f6

Please sign in to comment.