Skip to content

Commit 1cc43c9

Browse files
pre-commit-ci[bot]shaypal5
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 004be21 commit 1cc43c9

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ Running MongoDB tests against a live MongoDB instance
543543
544544
# Test MongoDB only
545545
./scripts/test-local.sh mongo
546-
546+
547547
# Test MongoDB with local backends
548548
./scripts/test-local.sh mongo memory pickle
549549

scripts/README-local-testing.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ The script automatically sets the required environment variables:
177177
docker rm cachier-test-mongo cachier-test-redis cachier-test-postgres
178178
```
179179

180-
181180
## Best Practices
182181

183182
1. **Before committing**: Run `./scripts/test-local.sh external` to test all external backends

tests/conftest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@
66
@pytest.fixture(scope="session", autouse=True)
77
def cleanup_mongo_clients():
88
"""Clean up any MongoDB clients created during tests.
9-
9+
1010
This fixture runs automatically after all tests complete.
11+
1112
"""
1213
# Let tests run
1314
yield
14-
15+
1516
# Cleanup after all tests
1617
try:
1718
from tests.test_mongo_core import _test_mongetter
19+
1820
if hasattr(_test_mongetter, "client"):
1921
# Close the MongoDB client to avoid ResourceWarning
2022
_test_mongetter.client.close()
2123
# Remove the client attribute so future test runs start fresh
2224
delattr(_test_mongetter, "client")
2325
except (ImportError, AttributeError):
2426
# If the module wasn't imported or client wasn't created, nothing to clean up
25-
pass
27+
pass

tests/test_mongo_core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import pymongo
2626
from pymongo.errors import OperationFailure
2727
from pymongo.mongo_client import MongoClient
28+
2829
from cachier.cores.mongo import MissingMongetter
2930
except (ImportError, ModuleNotFoundError):
3031
print("pymongo is not installed; tests requiring pymongo will fail!")

0 commit comments

Comments
 (0)