Skip to content

Commit 1fa7b9e

Browse files
committed
Revert "fix task teardown"
This reverts commit 5b49ba5.
1 parent 5b49ba5 commit 1fa7b9e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

tests/test_config.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ def test_config_with_uri_in_flask_conf_var(self):
4848
mongo = flask_pymongo.PyMongo(self.app, connect=True)
4949

5050
_wait_until_connected(mongo)
51-
assert mongo.cx is not None
52-
self.addCleanup(mongo.cx.close)
5351
assert mongo.db is not None
52+
assert mongo.cx is not None
5453
assert mongo.db.name == self.dbname
5554
assert ("localhost", self.port) == mongo.cx.address or (
5655
"127.0.0.1",
@@ -63,9 +62,8 @@ def test_config_with_uri_passed_directly(self):
6362
mongo = flask_pymongo.PyMongo(self.app, uri, connect=True)
6463

6564
_wait_until_connected(mongo)
66-
assert mongo.cx is not None
67-
self.addCleanup(mongo.cx.close)
6865
assert mongo.db is not None
66+
assert mongo.cx is not None
6967
assert mongo.db.name == self.dbname
7068
assert ("localhost", self.port) == mongo.cx.address or (
7169
"127.0.0.1",
@@ -93,8 +91,6 @@ class CustomDict(dict[str, Any]):
9391

9492
uri = f"mongodb://localhost:{self.port}/{self.dbname}"
9593
mongo = flask_pymongo.PyMongo(self.app, uri, document_class=CustomDict)
96-
assert mongo.cx is not None
97-
self.addCleanup(mongo.cx.close)
9894
assert mongo.db is not None
9995
assert mongo.db.things.find_one() is None, "precondition failed"
10096

0 commit comments

Comments
 (0)