diff --git a/tests/test_datastores.py b/tests/test_datastores.py index e0c8a17f..d5950ff4 100644 --- a/tests/test_datastores.py +++ b/tests/test_datastores.py @@ -857,5 +857,8 @@ async def test_psycopg(self) -> None: ) async def test_mongodb(self) -> None: - data_store = MongoDBDataStore("mongodb://localhost") - assert repr(data_store) == "MongoDBDataStore(host=[('localhost', 27017)])" + from pymongo import MongoClient + + with MongoClient() as client: + data_store = MongoDBDataStore(client) + assert repr(data_store) == "MongoDBDataStore(host=[('localhost', 27017)])"