Skip to content

Commit 6849fc7

Browse files
svetlyak40wtmdirolf
authored andcommitted
Added call to 'join' in threads test, to remove such ugly errors:
Exception in thread Thread-58 (most likely raised during interpreter shutdown): Exception in thread Thread-62 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner File "/home/art/git/mongo-python-driver/test/test_threads.py", line 31, in run File "/home/art/git/mongo-python-driver/pymongo/cursor.py", line 411, in next <type 'exceptions.TypeError'>: 'NoneType' object is not callable Signed-off-by: Mike Dirolf <mike@dirolf.com>
1 parent 721a763 commit 6849fc7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/test_threads.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@ def test_threading(self):
4343
for i in xrange(1000):
4444
self.db.test.save({"x": i})
4545

46+
threads = []
4647
for i in range(10):
4748
t = SaveAndFind(self.db.test)
4849
t.start()
50+
threads.append(t)
51+
52+
for t in threads:
53+
t.join()
4954

5055
if __name__ == "__main__":
5156
unittest.main()

0 commit comments

Comments
 (0)