Skip to content

Commit

Permalink
skip tests if key not set
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesturk committed Mar 26, 2023
1 parent 310d650 commit 1374ba6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_live_adversarial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Tests for adversarial examples
Tests for basic adversarial examples.
Note: There's basically no way for this library to be secure
against adversarial examples. Be careful with what you do with
Expand All @@ -8,9 +8,14 @@
This file is just to see how the library handles potential
adversarial examples.
"""
import os
import pytest
from scrapeghost import SchemaScraper

api_key_is_set = os.getenv("OPENAI_API_KEY", "")


@pytest.mark.skipif(not api_key_is_set, reason="requires API key")
def test_anti_scrape_language():
# note: haven't found language that works yet
html = """
Expand Down Expand Up @@ -46,6 +51,7 @@ def test_anti_scrape_language():
}


@pytest.mark.skipif(not api_key_is_set, reason="requires API key")
def test_forced_hallucination():
html = """
<html>
Expand Down

0 comments on commit 1374ba6

Please sign in to comment.