diff options
-rwxr-xr-x | runtests.py | 19 | ||||
-rw-r--r-- | setup.py | 4 | ||||
-rw-r--r-- | tox.ini | 29 |
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(""" @@ -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 @@ -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} |