Recent

2017-02-20
post

Testing uWSGI applications

Testing uWSGI applications can be tricky because you can't actually install and import uWSGI.

It's not very well documented, but

there is no uwsgi module. It does only exist when you run the python engine from uWSGI.

Many a developer has been frustrated by this during testing running into:

import uwsgi
>> Traceback (most recent call last):
>> File "", line 1, in
>> ImportError: No module named uwsgi

And although much of an application can be factored out into independent testable modules you will always have a small section that remains untested unless you engage in various levels of mocking.

Read More