Skip to content

Commit 68ead9b

Browse files
committed
Check for OpenAI key
1 parent 36eba35 commit 68ead9b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_cell_annotator.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
import pytest
24

35
from cell_annotator.cell_annotator import CellAnnotator
@@ -22,6 +24,7 @@ def cell_annotator(self):
2224

2325
@pytest.mark.openai()
2426
def test_get_expected_cell_type_markers(self, cell_annotator):
27+
assert os.getenv("OPENAI_API_KEY"), "OpenAI API key is not set"
2528
cell_annotator.get_expected_cell_type_markers()
2629
expected_markers = cell_annotator.expected_marker_genes
2730
print("Expected Markers:", expected_markers)
@@ -45,6 +48,7 @@ def test_get_expected_cell_type_markers(self, cell_annotator):
4548

4649
@pytest.mark.openai()
4750
def test_annotate_clusters(self, cell_annotator):
51+
assert os.getenv("OPENAI_API_KEY"), "OpenAI API key is not set"
4852
# Step 1: Call get_cluster_markers and run checks
4953
cell_annotator.get_cluster_markers(min_auc=0.6)
5054

@@ -81,6 +85,7 @@ def test_annotate_clusters(self, cell_annotator):
8185

8286
@pytest.mark.openai()
8387
def test_reorder_and_color_clusters(self, cell_annotator):
88+
assert os.getenv("OPENAI_API_KEY"), "OpenAI API key is not set"
8489
# Add a second annotation key to the adata object
8590
cell_annotator.adata.obs["leiden_2"] = cell_annotator.adata.obs["leiden"].copy()
8691

0 commit comments

Comments
 (0)