MCPcopy Create free account
hub / github.com/NanmiCoder/MediaCrawler / cleanup

Method cleanup

test/test_mongodb_integration.py:62–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60 def tearDownClass(cls):
61 if cls.mongodb_available:
62 async def cleanup():
63 conn = MongoDBConnection()
64 db = await conn.get_db()
65
66 test_collections = [
67 "test_xhs_contents",
68 "test_xhs_comments",
69 "test_xhs_creators",
70 "test_douyin_contents",
71 "test_douyin_comments",
72 "test_douyin_creators"
73 ]
74
75 for collection_name in test_collections:
76 try:
77 await db[collection_name].drop()
78 except:
79 pass
80
81 await conn.close()
82
83 try:
84 asyncio.run(cleanup())

Callers

nothing calls this directly

Calls 3

get_dbMethod · 0.95
closeMethod · 0.95
MongoDBConnectionClass · 0.90

Tested by

no test coverage detected