Skip to content

Commit 6064382

Browse files
Silence tests in staging (#419)
1 parent 889f389 commit 6064382

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tests/test_async_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ async def test_moved_fn(self) -> None:
6060
with self.assertRaises(ValueError):
6161
await self.co.list_connectors("dummy", dummy="dummy") # type: ignore
6262

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

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

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

123126
print(response)
124127

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

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

220+
@unittest.skipIf(os.getenv("CO_API_URL") is not None, "Doesn't work in staging.")
215221
async def test_connectors_crud(self) -> None:
216222
created_connector = await self.co.connectors.create(
217223
name="Example connector",

tests/test_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def test_moved_fn(self) -> None:
5959
with self.assertRaises(ValueError):
6060
co.list_connectors("dummy", dummy="dummy") # type: ignore
6161

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

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

122124
print(response)
123125

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

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

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

0 commit comments

Comments
 (0)