mirror of
https://github.com/hoshikawa2/nemo_guardrails_ci_cd.git
synced 2026-07-10 08:44:21 +00:00
first commit
This commit is contained in:
16
tests/conftest.py
Normal file
16
tests/conftest.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
from nemoguardrails import RailsConfig, LLMRails
|
||||
|
||||
os.environ.setdefault("OPENAI_API_KEY", "sk-fake")
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def project_root():
|
||||
return Path(__file__).resolve().parent.parent
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def rails(project_root):
|
||||
config_path = project_root / "config"
|
||||
config = RailsConfig.from_path(str(config_path))
|
||||
return LLMRails(config)
|
||||
Reference in New Issue
Block a user