Skip to content
Snippets Groups Projects
Commit 63a6041c authored by James Briggs's avatar James Briggs
Browse files

fix: skip if no pinecone api key

parent ace5a2d1
No related branches found
No related tags found
No related merge requests found
...@@ -190,6 +190,9 @@ def get_test_indexes(): ...@@ -190,6 +190,9 @@ def get_test_indexes():
@pytest.mark.parametrize("index_cls", get_test_indexes()) @pytest.mark.parametrize("index_cls", get_test_indexes())
class TestRouteLayer: class TestRouteLayer:
@pytest.mark.skipif(
os.environ.get("PINECONE_API_KEY") is None, reason="Pinecone API key required"
)
def test_initialization(self, openai_encoder, routes, index_cls): def test_initialization(self, openai_encoder, routes, index_cls):
index = init_index(index_cls) index = init_index(index_cls)
_ = RouteLayer( _ = RouteLayer(
...@@ -198,6 +201,9 @@ class TestRouteLayer: ...@@ -198,6 +201,9 @@ class TestRouteLayer:
if index_cls is PineconeIndex: if index_cls is PineconeIndex:
time.sleep(PINECONE_SLEEP) # allow for index to be populated time.sleep(PINECONE_SLEEP) # allow for index to be populated
@pytest.mark.skipif(
os.environ.get("PINECONE_API_KEY") is None, reason="Pinecone API key required"
)
def test_second_initialization_sync(self, openai_encoder, routes, index_cls): def test_second_initialization_sync(self, openai_encoder, routes, index_cls):
index = init_index(index_cls) index = init_index(index_cls)
route_layer = RouteLayer( route_layer = RouteLayer(
...@@ -205,6 +211,9 @@ class TestRouteLayer: ...@@ -205,6 +211,9 @@ class TestRouteLayer:
) )
assert route_layer.is_synced() assert route_layer.is_synced()
@pytest.mark.skipif(
os.environ.get("PINECONE_API_KEY") is None, reason="Pinecone API key required"
)
def test_second_initialization_not_synced(self, openai_encoder, routes_2, index_cls): def test_second_initialization_not_synced(self, openai_encoder, routes_2, index_cls):
index = init_index(index_cls) index = init_index(index_cls)
route_layer = RouteLayer( route_layer = RouteLayer(
...@@ -212,6 +221,9 @@ class TestRouteLayer: ...@@ -212,6 +221,9 @@ class TestRouteLayer:
) )
assert not route_layer.is_synced() assert not route_layer.is_synced()
@pytest.mark.skipif(
os.environ.get("PINECONE_API_KEY") is None, reason="Pinecone API key required"
)
def test_utterance_diff(self, openai_encoder, routes_2, index_cls): def test_utterance_diff(self, openai_encoder, routes_2, index_cls):
index = init_index(index_cls) index = init_index(index_cls)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment