From 66fcb0cc8f19564b1d8313f89d2d11f0d0a4122e Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 15 May 2017 09:49:25 +0800 Subject: [PATCH] Add py3*-no-ext test env --- tests/test_request_data.py | 6 +++++- tox.ini | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/tests/test_request_data.py b/tests/test_request_data.py index c874f71d..f795ff1f 100644 --- a/tests/test_request_data.py +++ b/tests/test_request_data.py @@ -2,7 +2,11 @@ import random from sanic import Sanic from sanic.response import json -from ujson import loads + +try: + from ujson import loads +except ImportError: + from json import loads def test_storage(): diff --git a/tox.ini b/tox.ini index dd940f13..498bfae4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,23 @@ [tox] -envlist = py35, py36, flake8, check - +envlist = py35, py36, {py35,py36}-no-ext, flake8, check [travis] python = - 3.5: py35, flake8, check - 3.6: py36, flake8, check - + 3.5: py35, py35-no-ext, flake8, check + 3.6: py36, py36-no-ext, flake8, check [testenv] +usedevelop = True +setenv = + {py35,py36}-no-ext: SANIC_NO_UJSON=1 + {py35,py36}-no-ext: SANIC_NO_UVLOOP=1 deps = - -rrequirements-dev.txt - + coverage + pytest + pytest-sugar + aiohttp==1.3.5 + chardet<=2.3.0 + beautifulsoup4 commands = pytest tests {posargs} coverage erase