mirror of
https://github.com/codeflash-ai/codeflash-agent.git
synced 2026-05-04 18:25:19 +00:00
Fix conftest collision between codeflash-api and github-app test suites
Both packages had tests/__init__.py, creating competing `tests` packages under --import-mode=importlib. Remove both __init__.py files and change github-app imports from `from tests.helpers` to `from helpers` via sys.path insertion in conftest.py.
This commit is contained in:
parent
43a4009294
commit
e41a1bf56a
6 changed files with 9 additions and 4 deletions
|
|
@ -3,6 +3,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
|
|
@ -10,7 +11,11 @@ import httpx
|
|||
import pytest
|
||||
import stamina
|
||||
|
||||
from tests.helpers import FAKE_RSA_PEM, WEBHOOK_SECRET
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
|
||||
from helpers import FAKE_RSA_PEM, WEBHOOK_SECRET, sign_payload # noqa: E402
|
||||
|
||||
__all__ = ["FAKE_RSA_PEM", "WEBHOOK_SECRET", "sign_payload"]
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True, scope="session")
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import json
|
|||
from pathlib import Path
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
from tests.helpers import sign_payload
|
||||
from helpers import sign_payload
|
||||
|
||||
|
||||
async def test_health_check(async_client):
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from github_app.auth import (
|
|||
get_installation_token,
|
||||
verify_signature,
|
||||
)
|
||||
from tests.helpers import WEBHOOK_SECRET
|
||||
from helpers import WEBHOOK_SECRET
|
||||
|
||||
|
||||
def test_generate_jwt_structure(mock_config):
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from unittest.mock import patch
|
|||
import pytest
|
||||
|
||||
from github_app.config import Config, default_plugin_dir, load_private_key
|
||||
from tests.helpers import FAKE_RSA_PEM
|
||||
from helpers import FAKE_RSA_PEM
|
||||
|
||||
|
||||
def test_load_private_key_from_env():
|
||||
|
|
|
|||
Loading…
Reference in a new issue