mirror of
https://github.com/vibe-existing/pyfragment.git
synced 2026-07-25 06:54:31 +00:00
refactor: enhance test workflow and integration tests with cookies handling and configuration checks
This commit is contained in:
+10
-1
@@ -1,13 +1,22 @@
|
||||
import pytest
|
||||
|
||||
from app.core.config import config
|
||||
from app.core.cookies import load_cookies
|
||||
from app.core.exceptions import CookiesError
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def cookies():
|
||||
"""Load Fragment cookies, skip the test if they are unavailable."""
|
||||
"""Load Fragment cookies; skip the test if they are unavailable."""
|
||||
try:
|
||||
return load_cookies()
|
||||
except CookiesError as exc:
|
||||
pytest.skip(f"Cookies unavailable — {exc}")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def tests_config():
|
||||
"""Require a fully configured environment (SEED + API_KEY); skip otherwise."""
|
||||
if config is None:
|
||||
pytest.skip("Config unavailable — set SEED and API_KEY in .env or environment")
|
||||
return config
|
||||
|
||||
Reference in New Issue
Block a user