Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Frank committed Oct 30, 2024
1 parent 9a92ca3 commit 7b775f4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/app/test_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ async def test_article_count(


@pytest.mark.asyncio
async def test_article_listing(get_testing_async_ds_client, request):
@pytest.mark.httpx_mock(can_send_already_matched_responses=True)
async def test_article_listing(get_testing_async_ds_client, mock_http_calls):
ds_client, parameters = get_testing_async_ds_client

request.getfixturevalue("mock_http_calls")
test_settings = Settings(
db={
"db_type": (
Expand Down
1 change: 1 addition & 0 deletions tests/scripts/test_parse_and_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ async def fake_close(self):


@pytest.mark.asyncio
@pytest.mark.httpx_mock(can_send_already_matched_responses=True)
@patch("scholarag.document_stores.AsyncOpenSearch.close", new=fake_close)
async def test_run_with_es_instance(tmp_path, httpx_mock, get_testing_async_ds_client):
ds_client, parameters = get_testing_async_ds_client
Expand Down
1 change: 1 addition & 0 deletions tests/scripts/test_pmc_parse_and_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@


@pytest.mark.asyncio
@pytest.mark.httpx_mock(can_send_already_matched_responses=True)
async def test_pmc_parse_and_upload(httpx_mock, get_testing_async_ds_client):
ds_client, parameters = get_testing_async_ds_client
index = "paragraphs_parse_script_pytest"
Expand Down
1 change: 1 addition & 0 deletions tests/test_retrieve_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ async def test_metadata_retriever_recreate_abstract_with_db(
@pytest.mark.parametrize(
["issn", "name"], [("1234-5678", "great_journal"), ("3426-1936", "bad_journal")]
)
@pytest.mark.httpx_mock(can_send_already_matched_responses=True)
async def test_get_journal_name(httpx_mock, issn, name):
# If ISSN is None
async with httpx.AsyncClient() as client:
Expand Down

0 comments on commit 7b775f4

Please sign in to comment.