1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

tests/gevent: skip gevent monkey patch when running tests

This commit is contained in:
Ilya Kreymer 2016-03-20 22:23:07 -07:00
parent 08cb02c644
commit 4b37d13c34
2 changed files with 11 additions and 5 deletions

3
pywb/apps/conftest.py Normal file
View File

@ -0,0 +1,3 @@
def pytest_configure(config):
import sys
sys._called_from_test = True

View File

@ -1,8 +1,11 @@
# Use gevent if available
try:
from gevent.monkey import patch_all; patch_all()
except Exception as e:
pass
import sys
if not hasattr(sys, '_called_from_test'): #pragma: no cover
# Use gevent if available
try:
from gevent.monkey import patch_all; patch_all()
except Exception as e:
pass
from pywb.framework.wsgi_wrappers import init_app
from pywb.webapp.pywb_init import create_wb_router