MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_threading

Method test_threading

test/test_threads.py:111–121  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

109 self.db = self.client.pymongo_test
110
111 def test_threading(self):
112 self.db.drop_collection("test")
113 self.db.test.insert_many([{"x": i} for i in range(1000)])
114
115 threads = []
116 for _i in range(10):
117 t = SaveAndFind(self.db.test)
118 t.start()
119 threads.append(t)
120
121 joinall(threads)
122
123 def test_safe_insert(self):
124 self.db.drop_collection("test1")

Callers

nothing calls this directly

Calls 5

joinallFunction · 0.90
SaveAndFindClass · 0.85
drop_collectionMethod · 0.45
insert_manyMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected