Skip to content

Commit

Permalink
Skip joke test if the api key isn't set
Browse files Browse the repository at this point in the history
  • Loading branch information
TechNickAI committed Jun 20, 2023
1 parent a5a25d0 commit 99acf05
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from cli import joke, version
from click.testing import CliRunner
from setup import __version__
import os, pytest


def test_version():
Expand All @@ -10,6 +11,7 @@ def test_version():
assert __version__ in result.output


@pytest.mark.skipif(os.getenv("OPENAI_API_KEY") is None, reason="Skipping live tests without an API key.")
def test_joke():
runner = CliRunner()
result = runner.invoke(joke)
Expand Down

0 comments on commit 99acf05

Please sign in to comment.