Skip to content

Commit

Permalink
Import FixtureRequest from pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
cbornet committed Aug 20, 2024
1 parent eb54a9f commit 10dbac5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions libs/colbert/tests/integration_tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Iterator

import pytest
from _pytest.fixtures import FixtureRequest
from cassandra.cluster import Session
from ragstack_tests_utils import AstraDBTestStore, LocalCassandraTestStore

Expand All @@ -20,7 +19,7 @@ def astra_db() -> AstraDBTestStore:


@pytest.fixture()
def session(request: FixtureRequest) -> Session:
def session(request: pytest.FixtureRequest) -> Session:
test_store = request.getfixturevalue(request.param)
session = test_store.create_cassandra_session()
session.default_timeout = 180
Expand Down
5 changes: 2 additions & 3 deletions libs/langchain/tests/integration_tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Iterator

import pytest
from _pytest.fixtures import FixtureRequest
from cassandra.cluster import Session
from dotenv import load_dotenv
from ragstack_tests_utils import AstraDBTestStore, LocalCassandraTestStore
Expand All @@ -22,13 +21,13 @@ def astra_db() -> AstraDBTestStore:
return AstraDBTestStore()


def get_session(request: FixtureRequest) -> Session:
def get_session(request: pytest.FixtureRequest) -> Session:
test_store = request.getfixturevalue(request.param)
session = test_store.create_cassandra_session()
session.default_timeout = 180
return session


@pytest.fixture()
def session(request: FixtureRequest) -> Session:
def session(request: pytest.FixtureRequest) -> Session:
return get_session(request)
3 changes: 1 addition & 2 deletions libs/llamaindex/tests/integration_tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Iterator

import pytest
from _pytest.fixtures import FixtureRequest
from cassandra.cluster import Session
from ragstack_tests_utils import AstraDBTestStore, LocalCassandraTestStore

Expand All @@ -20,7 +19,7 @@ def astra_db() -> AstraDBTestStore:


@pytest.fixture()
def session(request: FixtureRequest) -> Session:
def session(request: pytest.FixtureRequest) -> Session:
test_store = request.getfixturevalue(request.param)
session = test_store.create_cassandra_session()
session.default_timeout = 180
Expand Down

0 comments on commit 10dbac5

Please sign in to comment.