Skip to content

Commit 756b78e

Browse files
authored
skip openai integ tests if key not set (#1662)
1 parent 4acd5f0 commit 756b78e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tests/integration/test_eval.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
import os
12
from pathlib import Path
23
from typing import Callable
34

45
import pytest
56

67
from tests.conftest import Command, Environment, ProcessResult
78

8-
pytestmark = [pytest.mark.slow]
9+
pytestmark = [
10+
pytest.mark.slow,
11+
pytest.mark.skipif(not os.environ.get("OPENAI_API_KEY"), reason="OPENAI_API_KEY not set"),
12+
]
913

1014

1115
@pytest.fixture(scope="module")

tests/integration/test_synthesize.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
import os
12
from pathlib import Path
23
from typing import Callable
34

45
import pytest
56

67
from tests.conftest import Command, Environment, ProcessResult
78

8-
pytestmark = [pytest.mark.slow]
9+
pytestmark = [
10+
pytest.mark.slow,
11+
pytest.mark.skipif(not os.environ.get("OPENAI_API_KEY"), reason="OPENAI_API_KEY not set"),
12+
]
913

1014

1115
@pytest.fixture(scope="module")

0 commit comments

Comments
 (0)