8000 fix: Fix hypothesis test by untitaker · Pull Request #978 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content

fix: Fix hypothesis test #978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2021
Merged
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
24 changes: 15 additions & 9 deletions tests/test_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@
pass
else:

@given(binary=st.binary(min_size=1))
def test_bytes_serialization_decode_many(binary, message_normalizer):
result = message_normalizer(binary, should_repr_strings=False)
assert result == binary.decode("utf-8", "replace")

@given(binary=st.binary(min_size=1))
def test_bytes_serialization_repr_many(binary, message_normalizer):
result = message_normalizer(binary, should_repr_strings=True)
assert result == repr(binary)
def test_bytes_serialization_decode_many(message_normalizer):
@given(binary=st.binary(min_size=1))
def inner(binary):
result = message_normalizer(binary, should_repr_strings=False)
assert result == binary.decode("utf-8", "replace")

inner()

def test_bytes_serialization_repr_many(message_normalizer):
@given(binary=st.binary(min_size=1))
def inner(binary):
result = message_normalizer(binary, should_repr_strings=True)
assert result == repr(binary)

inner()


@pytest.fixture
Expand Down
0