Skip to content

Commit

Permalink
fixing tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
royerloic committed Aug 31, 2024
1 parent 8c92a6f commit 83357ad
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/napari_chatgpt/utils/web/test/wikipedia_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
from napari_chatgpt.utils.api_keys.api_key import is_api_key_available
from napari_chatgpt.utils.web.wikipedia import search_wikipedia

import os

# Skip tests that require API keys in Github Actions
IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"

@pytest.mark.skipif(IN_GITHUB_ACTIONS, reason="Test doesn't work in Github Actions.")
def test_wikipedia_search_MM():

try:
Expand All @@ -24,11 +29,8 @@ def test_wikipedia_search_MM():
import traceback
traceback.print_exc()




@pytest.mark.skipif(not is_api_key_available('OpenAI'),
reason="requires OpenAI key to run")
@pytest.mark.skipif(IN_GITHUB_ACTIONS or not is_api_key_available('OpenAI'),
reason="requires OpenAI key to run and doesn't work in Github Actions.")
def test_wikipedia_search_AE():

try:
Expand Down

0 comments on commit 83357ad

Please sign in to comment.