summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2015-07-11 16:11:26 +0200
committerVictor Stinner <vstinner@redhat.com>2015-07-11 16:11:55 +0200
commit1ade79951df23e8bd7d173ea1025b95768e8b2b7 (patch)
treef50c4c2c7913c0da58eefedf27c42963ad92155c
parente82d8c676a7adcd797836bd5974ced28ca8febbd (diff)
downloadtrollius-git-1ade79951df23e8bd7d173ea1025b95768e8b2b7.tar.gz
Test without ssl or without concurrent
-rwxr-xr-xruntests.py19
-rw-r--r--setup.py4
-rw-r--r--tox.ini29
3 files changed, 44 insertions, 8 deletions
diff --git a/runtests.py b/runtests.py
index 38626af..541a47e 100755
--- a/runtests.py
+++ b/runtests.py
@@ -29,7 +29,8 @@ import random
import re
import sys
import textwrap
-from trollius.compat import PY33
+PY2 = (sys.version_info < (3,))
+PY33 = (sys.version_info >= (3, 3))
if PY33:
import importlib.machinery
else:
@@ -38,7 +39,7 @@ try:
import coverage
except ImportError:
coverage = None
-if sys.version_info < (3,):
+if PY2:
sys.exc_clear()
try:
@@ -58,6 +59,12 @@ ARGS.add_option(
'-f', '--failfast', action="store_true", default=False,
dest='failfast', help='Stop on first fail or error')
ARGS.add_option(
+ '--no-ssl', action="store_true", default=False,
+ help='Disable the SSL module')
+ARGS.add_option(
+ '--no-concurrent', action="store_true", default=False,
+ help='Disable the concurrent module')
+ARGS.add_option(
'-c', '--catch', action="store_true", default=False,
dest='catchbreak', help='Catch control-C and display results')
ARGS.add_option(
@@ -121,7 +128,7 @@ def load_modules(basedir, suffix='.py'):
for modname, sourcefile in list_dir('', basedir):
if modname == 'runtests':
continue
- if modname == 'test_asyncio' and sys.version_info <= (3, 3):
+ if modname == 'test_asyncio' and not PY33:
print("Skipping '{0}': need at least Python 3.3".format(modname),
file=sys.stderr)
continue
@@ -238,6 +245,12 @@ def _runtests(args, tests):
def runtests():
args, pattern = ARGS.parse_args()
+ if args.no_ssl:
+ sys.modules['ssl'] = None
+
+ if args.no_concurrent:
+ sys.modules['concurrent'] = None
+
if args.coverage and coverage is None:
URL = "bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py"
print(textwrap.dedent("""
diff --git a/setup.py b/setup.py
index 9ec90cc..407e314 100644
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,7 @@
# Release procedure:
# - fill trollius changelog
# - run maybe ./update_asyncio_step1.sh
-# - run unit tests with concurrent.futures
-# - run unit tests without concurrent.futures
-# - run unit tests without ssl: set sys.modules['ssl']=None at startup
+# - run all tests: tox
# - test examples
# - update version in setup.py (version) and doc/conf.py (version, release)
# - set release date in doc/changelog.rst
diff --git a/tox.ini b/tox.ini
index 9a1b1aa..5630059 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py26,py27,py2_release,py32,py33,py34,py3_release
+envlist = py26,py27,py2_release,py2_no_ssl,py2_no_concurrent,py32,py33,py34,py3_release,py3_no_ssl
# and: pyflakes2,pyflakes3
[testenv]
@@ -42,6 +42,7 @@ deps=
[testenv:py2_release]
# Run tests in release mode
+basepython = python2
deps=
aiotest
futures
@@ -49,7 +50,26 @@ deps=
unittest2
setenv =
TROLLIUSDEBUG =
-basepython = python2.7
+
+[testenv:py2_no_ssl]
+basepython = python2
+deps=
+ aiotest
+ futures
+ mock
+ unittest2
+commands=
+ python runtests.py --no-ssl -r {posargs}
+
+[testenv:py2_no_concurrent]
+basepython = python2
+deps=
+ aiotest
+ futures
+ mock
+ unittest2
+commands=
+ python runtests.py --no-concurrent -r {posargs}
[testenv:py32]
deps=
@@ -61,6 +81,11 @@ basepython = python3.5
[testenv:py3_release]
# Run tests in release mode
+basepython = python3
setenv =
TROLLIUSDEBUG =
+
+[testenv:py3_no_ssl]
basepython = python3
+commands=
+ python runtests.py --no-ssl -r {posargs}