man-group / pytest-plugins

A grab-bag of nifty pytest plugins
MIT License
559 stars 83 forks source link

pytest-server-fixtures: Explicitly close initial Mongo client #198

Closed lwfitzgerald closed 2 years ago

lwfitzgerald commented 2 years ago

When checking the Mongo server has come up properly, the MongoTestServer class first creates a pymongo.MongoClient with a short timeout to avoid waiting a long time in the failure case. After this it creates another client with the default timeouts, but prior to this change, the initial client is not closed.

This change explicitly closes the initial client after use.

eeaston commented 2 years ago

LGTM, thanks.