From 78cbfb901f5abee46e2250a221cde09c2a865515 Mon Sep 17 00:00:00 2001 From: Xuebin Su Date: Tue, 21 Nov 2023 03:34:39 -0500 Subject: [PATCH] Fixture names are different from hook args --- tests/conftest.py | 8 ++++---- tests/test_embedding.py | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 7f0877f4..0d945518 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,14 +17,14 @@ def pytest_addoption(parser: pytest.Parser): @pytest.fixture(scope="session") -def server_use_pickler(config: pytest.Config) -> bool: - val: bool = config.getini("server_use_pickler") +def server_use_pickler(pytestconfig: pytest.Config) -> bool: + val: bool = pytestconfig.getini("server_use_pickler") return val @pytest.fixture(scope="session") -def server_has_pgvector(config: pytest.Config) -> bool: - val: bool = config.getini("server_has_pgvector") +def server_has_pgvector(pytestconfig: pytest.Config) -> bool: + val: bool = pytestconfig.getini("server_has_pgvector") return val diff --git a/tests/test_embedding.py b/tests/test_embedding.py index 1bcb4781..1a82ee00 100644 --- a/tests/test_embedding.py +++ b/tests/test_embedding.py @@ -1,4 +1,3 @@ -import _pytest import pytest import greenplumpython as gp @@ -6,7 +5,7 @@ @pytest.mark.requires_pgvector -def test_embedding_query_string(db): +def test_embedding_query_string(db: gp.Database): content = ["I have a dog.", "I like eating apples."] t = ( db.create_dataframe(columns={"id": range(len(content)), "content": content})