Skip to content

Commit 9b4ac11

Browse files
committed
test: use shared postgres uri
1 parent 65ed067 commit 9b4ac11

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

tests/conftest.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ def vcr_config():
7272

7373

7474
@pytest.fixture(scope="session")
75-
def anyvlm_anyvar_postgres_uri():
75+
def anyvlm_postgres_uri():
7676
return environ.get(
77-
"ANYVLM_ANYVAR_TEST_STORAGE_URI",
78-
"postgresql://postgres:postgres@localhost:5432/anyvlm_anyvar_test",
77+
"ANYVLM_TEST_STORAGE_URI",
78+
"postgresql://postgres:postgres@localhost:5432/anyvlm_test",
7979
)
8080

8181

8282
@pytest.fixture
83-
def anyvar_python_client(anyvlm_anyvar_postgres_uri: str) -> PythonAnyVarClient:
84-
storage = create_storage(anyvlm_anyvar_postgres_uri)
83+
def anyvar_python_client(anyvlm_postgres_uri: str) -> PythonAnyVarClient:
84+
storage = create_storage(anyvlm_postgres_uri)
8585
storage.wipe_db()
8686
translator = create_translator()
8787
return PythonAnyVarClient(translator, storage)
@@ -101,14 +101,6 @@ def anyvar_populated_python_client(
101101
return anyvar_python_client
102102

103103

104-
@pytest.fixture(scope="session")
105-
def anyvlm_postgres_uri():
106-
return environ.get(
107-
"ANYVLM_TEST_STORAGE_URI",
108-
"postgresql://postgres:postgres@localhost:5432/anyvlm_test",
109-
)
110-
111-
112104
@pytest.fixture
113105
def postgres_storage(anyvlm_postgres_uri: str):
114106
"""Reset storage state after each test case"""

tests/unit/anyvar/test_clients.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717

1818
@pytest.fixture
19-
def anyvar_http_client(anyvlm_anyvar_postgres_uri: str) -> HttpAnyVarClient:
19+
def anyvar_http_client(anyvlm_postgres_uri: str) -> HttpAnyVarClient:
2020
"""Create test fixture for AnyVar HTTP client"""
21-
storage = create_storage(anyvlm_anyvar_postgres_uri)
21+
storage = create_storage(anyvlm_postgres_uri)
2222
storage.wipe_db()
2323
return HttpAnyVarClient()
2424

0 commit comments

Comments
 (0)