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

Class SaveAndFind

test/test_threads.py:44–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42
43
44class SaveAndFind(threading.Thread):
45 def __init__(self, collection):
46 threading.Thread.__init__(self)
47 self.collection = collection
48 self.daemon = True
49 self.passed = False
50
51 def run(self):
52 sum = 0
53 for document in self.collection.find():
54 sum += document["x"]
55
56 assert sum == 499500, "sum was %d not 499500" % sum
57 self.passed = True
58
59
60class Insert(threading.Thread):

Callers 1

test_threadingMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_threadingMethod · 0.68