Skip to content

Commit

Permalink
Silence tests in staging (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
billytrend-cohere authored Mar 20, 2024
1 parent 889f389 commit 6064382
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ async def test_moved_fn(self) -> None:
with self.assertRaises(ValueError):
await self.co.list_connectors("dummy", dummy="dummy") # type: ignore

@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
async def test_generate(self) -> None:
response = await self.co.generate(
prompt='Please explain to me how LLMs work',
)
print(response)

@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
async def test_embed(self) -> None:
response = await self.co.embed(
texts=['hello', 'goodbye'],
Expand All @@ -74,6 +76,7 @@ async def test_embed(self) -> None:
)
print(response)

@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
async def test_embed_job_crud(self) -> None:
dataset = await self.co.datasets.create(
name="test",
Expand Down Expand Up @@ -122,6 +125,7 @@ async def test_rerank(self) -> None:

print(response)

@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
async def test_classify(self) -> None:
examples = [
ClassifyExample(text="Dermatologists don't like her!", label="Spam"),
Expand Down Expand Up @@ -149,6 +153,7 @@ async def test_classify(self) -> None:
)
print(response)

@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
async def test_datasets_crud(self) -> None:
my_dataset = await self.co.datasets.create(
name="test",
Expand Down Expand Up @@ -212,6 +217,7 @@ async def test_detokenize(self) -> None:
)
print(response)

@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
async def test_connectors_crud(self) -> None:
created_connector = await self.co.connectors.create(
name="Example connector",
Expand Down
5 changes: 5 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def test_moved_fn(self) -> None:
with self.assertRaises(ValueError):
co.list_connectors("dummy", dummy="dummy") # type: ignore

@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
def test_generate(self) -> None:
response = co.generate(
prompt='Please explain to me how LLMs work',
Expand All @@ -73,6 +74,7 @@ def test_embed(self) -> None:
)
print(response)

@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
def test_embed_job_crud(self) -> None:
dataset = co.datasets.create(
name="test",
Expand Down Expand Up @@ -121,6 +123,7 @@ def test_rerank(self) -> None:

print(response)

@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
def test_classify(self) -> None:
examples = [
ClassifyExample(text="Dermatologists don't like her!", label="Spam"),
Expand Down Expand Up @@ -148,6 +151,7 @@ def test_classify(self) -> None:
)
print(response)

@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
def test_datasets_crud(self) -> None:
my_dataset = co.datasets.create(
name="test",
Expand Down Expand Up @@ -211,6 +215,7 @@ def test_detokenize(self) -> None:
)
print(response)

@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
def test_connectors_crud(self) -> None:
created_connector = co.connectors.create(
name="Example connector",
Expand Down

0 comments on commit 6064382

Please sign in to comment.