Skip to content

Commit 0a94757

Browse files
authored
chore: skip tests if ZEN_API_KEY is not set (run-llama#17143)
1 parent 112d307 commit 0a94757

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

llama-index-packs/llama-index-packs-zenguard/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ version = "0.3.0"
4444

4545
[tool.poetry.dependencies]
4646
python = ">=3.9,<4.0"
47-
zenguard = "^0.1.13"
47+
zenguard = "^0.2.1"
4848
llama-index-core = "^0.12.0"
4949

5050
[tool.poetry.group.dev.dependencies]

llama-index-packs/llama-index-packs-zenguard/tests/test_packs_zenguard.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
import pytest
2-
1+
import os
32
from typing import Dict
43

4+
import pytest
55
from llama_index.core.llama_pack import BaseLlamaPack
66
from llama_index.packs.zenguard import (
7-
ZenGuardPack,
8-
ZenGuardConfig,
97
Credentials,
108
Detector,
9+
ZenGuardConfig,
10+
ZenGuardPack,
11+
)
12+
13+
pytestmark = pytest.mark.skipif(
14+
os.environ.get("ZEN_API_KEY") is None, reason="ZEN_API_KEY not set"
1115
)
1216

1317

1418
@pytest.fixture()
1519
def zenguard_pack():
16-
api_key = "3Ev_DGvELv7EnlgWMTlpmWTo82tpstyz4Li_R7kTDQw" # mock key. whitelisted only for LlamaIndex tests.
20+
api_key = os.environ.get("ZEN_API_KEY")
1721
config = ZenGuardConfig(credentials=Credentials(api_key=api_key))
1822
return ZenGuardPack(config)
1923

0 commit comments

Comments
 (0)