segmentio/analytics-python — pull request #38 by cirotix (2014-12-29 22:26:51+00:00)
Title: make it really testable

I think that that the send toggle provided by PR #31 would be much better if instead of not queuing it would rather not start the Consumer thread.
It provides fast execution (enqueing is fast, consuming is not) as in the original implementation, but it also provides a better solution for testing (on the client side).

With this patch you are able to test that the messages are correctly written in the queue, with the expected metadata.