pymongo-job-queue icon indicating copy to clipboard operation
pymongo-job-queue copied to clipboard

Iterator unit test

Open accraze opened this issue 8 years ago • 0 comments

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

accraze avatar Jan 07 '16 18:01 accraze