Skip to content

Commit

Permalink
fix flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abidlabs committed Oct 5, 2024
1 parent b82aa6f commit 4388ee3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/python/gradio_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ def __init__(
]
self.parameters_info = self._get_parameters_info()

self.root_url = client.src.rstrip("/") + "/" + client.api_prefix
self.root_url = self.client.src_prefixed

# Disallow hitting endpoints that the Gradio app has disabled
self.is_valid = self.api_name is not False
Expand Down
4 changes: 3 additions & 1 deletion client/python/test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_private_space(self):
space_id = "gradio-tests/not-actually-private-space"
api = huggingface_hub.HfApi()
assert api.space_info(space_id).private
client = Client(space_id)
client = Client(space_id, hf_token=None)
output = client.predict("abc", api_name="/predict")
assert output == "abc"

Expand All @@ -141,6 +141,7 @@ def test_private_space_v4(self):
assert api.space_info(space_id).private
client = Client(
space_id,
hf_token=None,
)
output = client.predict("abc", api_name="/predict")
assert output == "abc"
Expand All @@ -152,6 +153,7 @@ def test_private_space_v4_sse_v1(self):
assert api.space_info(space_id).private
client = Client(
space_id,
hf_token=None,
)
output = client.predict("abc", api_name="/predict")
assert output == "abc"
Expand Down

0 comments on commit 4388ee3

Please sign in to comment.