Skip to content

Commit

Permalink
Move unit tests to dedicated folder (tests/unit)
Browse files Browse the repository at this point in the history
Signed-off-by: Teo <[email protected]>
  • Loading branch information
teocns committed Jan 12, 2025
1 parent e2a87e7 commit 4261f51
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 18 deletions.
18 changes: 0 additions & 18 deletions tests/conftest.py

This file was deleted.

Empty file added tests/unit/__init__.py
Empty file.
36 changes: 36 additions & 0 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import contextlib
from typing import Iterator

import pytest
import requests_mock
from pytest import Config, Session

import agentops
from agentops.singleton import clear_singletons
from tests.fixtures.event import llm_event_spy
from tests.fixtures.vcr import vcr_config

# Common JWT tokens used across tests
JWTS = ["some_jwt", "some_jwt2", "some_jwt3"]


@pytest.fixture(autouse=True)
def setup_teardown():
"""
Ensures that all agentops sessions are closed and singletons are cleared in-between tests
"""
clear_singletons()
yield
agentops.end_all_sessions() # teardown part


@pytest.fixture(scope="session")
def api_key() -> str:
"""Standard API key for testing"""
return "11111111-1111-4111-8111-111111111111"


@pytest.fixture(scope="session")
def base_url() -> str:
"""Base API URL"""
return "https://api.agentops.ai"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4261f51

Please sign in to comment.