pymongo-job-queue
pymongo-job-queue copied to clipboard
Iterator unit test
Need to figure out how to unit test JobQueue.__iter__
...
see https://github.com/discogs/pymongo-job-queue/blob/master/pymjq/test.py#L50
Due to the cursor staying open and waiting for new documents to enter the queue, this method never returns unless given a KeyboardInterrupt
.
A possible solution might be to use a timeout decorator: https://pypi.python.org/pypi/timeout-decorator