This error happens when an empty list is passed to insert_many:
>>> client.t.t.insert_many([])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/shane/git/mongo-python-driver/pymongo/_csot.py", line 105, in csot_wrapper
return func(self, *args, **kwargs)
File "/Users/shane/git/mongo-python-driver/pymongo/collection.py", line 691, in insert_many
raise TypeError("documents must be a non-empty list")
TypeError: documents must be a non-empty list
This error happens when an empty list is passed to insert_many: