Skip to content
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

chore: Fix test warnings #302

Merged
merged 1 commit into from
Aug 8, 2024
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
2 changes: 1 addition & 1 deletion ldclient/testing/impl/test_attribute_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_ref_simple_with_leading_slash(self, input: str, unescaped: str):
assert a.depth == 1
assert a[0] == unescaped

@pytest.mark.parametrize("input", [])
@pytest.mark.parametrize("input", [("name"), ("name/with/slashes"), ("name~0~1with-what-looks-like-escape-sequences")])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was never testing anything, which is pretty silly.

def test_literal(self, input: str):
a = AttributeRef.from_literal(input)
assert a.valid is True
Expand Down
2 changes: 0 additions & 2 deletions ldclient/testing/test_ldclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,12 @@ def test_client_has_null_update_processor_in_ldd_mode():
assert isinstance(client._update_processor, NullUpdateProcessor)


@pytest.mark.skip("Can't currently use a live stream processor in tests because its error logging will disrupt other tests.")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is no longer true it seems, so I'm removing those two skips.

def test_client_has_streaming_processor_by_default():
config = Config(sdk_key="secret", base_uri=unreachable_uri, stream_uri=unreachable_uri, send_events=False)
with LDClient(config=config, start_wait=0) as client:
assert isinstance(client._update_processor, StreamingUpdateProcessor)


@pytest.mark.skip("Can't currently use a live polling processor in tests because its error logging will disrupt other tests.")
def test_client_has_polling_processor_if_streaming_is_disabled():
config = Config(sdk_key="secret", stream=False, base_uri=unreachable_uri, stream_uri=unreachable_uri, send_events=False)
with LDClient(config=config, start_wait=0) as client:
Expand Down
Loading