Skip to content

Commit

Permalink
ci round 4
Browse files Browse the repository at this point in the history
  • Loading branch information
olirice committed Jun 21, 2024
1 parent d4f9bab commit 71826e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
jobs:
test:
runs-on: ubuntu-latest
environment: env
strategy:
matrix:
python-version: ['3.9']
Expand Down
14 changes: 2 additions & 12 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,8 @@ def cursor(maybe_start_pg: None, postgres_connection_string: str):


@pytest.fixture(scope="session")
def pinecone_apikey() -> Generator[str, None, None]:
try:
yield environ[pinecone.PINECONE_APIKEY]
except KeyError:
raise Exception(
"Pinecone APIKEY required to run the test suite. Create an API key and store it in an environment variable named {pinecone.PINECONE_APIKEY}. A free account is sufficient"
)


@pytest.fixture(scope="session")
def pinecone_client(pinecone_apikey) -> Pinecone:
return Pinecone(api_key=pinecone_apikey)
def pinecone_client() -> Pinecone:
return Pinecone(api_key=environ[pinecone.PINECONE_APIKEY])


@pytest.fixture(scope="session")
Expand Down
7 changes: 4 additions & 3 deletions tests/test_pinecone.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from os import environ

from pinecone import Pinecone
from pinecone.data.index import Index
from typer.testing import CliRunner

from vec2pg.cli import app
from vec2pg.plugins.pinecone import to_qualified_table_name
from vec2pg.plugins.pinecone import PINECONE_APIKEY, to_qualified_table_name


def test_pinecone_subcommand_does_not_error() -> None:
Expand All @@ -20,7 +22,6 @@ def test_index_is_good(pinecone_index: Index) -> None:


def test_pinecone_migrate(
pinecone_apikey,
pinecone_namespace,
pinecone_index_name,
postgres_connection_string,
Expand All @@ -32,7 +33,7 @@ def test_pinecone_migrate(
[
"pinecone",
"migrate",
pinecone_apikey,
environ[PINECONE_APIKEY],
pinecone_index_name,
pinecone_namespace,
postgres_connection_string,
Expand Down

0 comments on commit 71826e4

Please sign in to comment.