Skip to content

Instantly share code, notes, and snippets.

@tomdottom
Created February 21, 2017 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomdottom/afaf3a45e22dd000e9d23249dd74b0a8 to your computer and use it in GitHub Desktop.
Save tomdottom/afaf3a45e22dd000e9d23249dd74b0a8 to your computer and use it in GitHub Desktop.
import mock
import sys
# Create a mock `uwsgi` module so that
# import uwsgi does not throw an ImportError
uwsgi = mock.MagicMock()
sys.modules.setdefault('uwsgi', uwsgi)
uwsgidecorators = mock.MagicMock()
uwsgidecorators.postfork = lambda x: x
sys.modules.setdefault('uwsgidecorators', uwsgidecorators)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment