Skip to content

Commit

Permalink
protect more async tests from spurious resource warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hemidactylus committed Jul 23, 2024
1 parent 9635385 commit f92cd89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,13 @@ async def test_chatms_coreclients_init_async(
astra_db_client=core_astra_db,
setup_mode=SetupMode.ASYNC,
)
assert len(rec_warnings) == 1
# cleaning out 'spurious' "unclosed socket/transport..." warnings
f_rec_warnings = [
wrn
for wrn in rec_warnings
if not issubclass(wrn.category, ResourceWarning)
]
assert len(f_rec_warnings) == 1
assert await chatmh_init_core.aget_messages() == test_messages
finally:
await chatmh_init_ok.astra_env.async_collection.drop()
8 changes: 7 additions & 1 deletion libs/astradb/tests/integration_tests/test_vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,13 @@ async def test_astradb_vectorstore_indexing_async(
setup_mode=SetupMode.ASYNC,
)
await leg_store.aadd_texts(["Triggering warning."])
assert len(rec_warnings) == 1
# cleaning out 'spurious' "unclosed socket/transport..." warnings
f_rec_warnings = [
wrn
for wrn in rec_warnings
if not issubclass(wrn.category, ResourceWarning)
]
assert len(f_rec_warnings) == 1

await database.to_async().drop_collection("lc_legacy_coll")
await database.to_async().drop_collection("lc_default_idx")
Expand Down

0 comments on commit f92cd89

Please sign in to comment.