diff --git a/.travis.yml b/.travis.yml index e45cc1c1..2b6d6665 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,9 @@ matrix: env: TOXENV=py35 - python: "3.6" env: TOXENV=py36 + - os: linux + python: 3.8 + env: TOXENV=py38 - os: linux dist: xenial python: 3.7 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5bb51160..66902a4a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -59,4 +59,4 @@ jobs: pip install -U tox displayName: 'Install dependencies' - script: tox -e py - displayName: 'Run Tox' \ No newline at end of file + displayName: 'Run Tox' diff --git a/setup.cfg b/setup.cfg index cc0025d9..5802826b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,6 +20,7 @@ classifier = Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 Topic :: Software Development :: Testing Topic :: Software Development :: Quality Assurance project_urls = diff --git a/stestr/repository/memory.py b/stestr/repository/memory.py index 5bc31d83..2d60f00a 100644 --- a/stestr/repository/memory.py +++ b/stestr/repository/memory.py @@ -14,7 +14,6 @@ from extras import try_import -OrderedDict = try_import('collections.OrderedDict', dict) from io import BytesIO from operator import methodcaller @@ -23,6 +22,8 @@ from stestr.repository import abstract as repository +OrderedDict = try_import('collections.OrderedDict', dict) + class RepositoryFactory(repository.AbstractRepositoryFactory): """A factory that can initialise and open memory repositories. @@ -152,8 +153,8 @@ def _handle_test(self, test_dict): duration_delta = stop - start duration_seconds = ( (duration_delta.microseconds + ( - duration_delta.seconds + duration_delta.days - * 24 * 3600) * 10 ** 6) / 10.0 ** 6) + duration_delta.seconds + + duration_delta.days * 24 * 3600) * 10 ** 6) / 10.0 ** 6) self._repository._times[test_dict['id']] = duration_seconds def stopTestRun(self): diff --git a/stestr/scheduler.py b/stestr/scheduler.py index b2280e50..60e01971 100644 --- a/stestr/scheduler.py +++ b/stestr/scheduler.py @@ -109,6 +109,9 @@ def partition_tests(test_ids, concurrency, repository, group_callback, :return: A list where each element is a distinct subset of test_ids, and the union of all the elements is equal to set(test_ids). """ + def noop(_): + return None + _group_callback = group_callback partitions = [list() for i in range(concurrency)] timed_partitions = [[0.0, partition] for partition in partitions] @@ -123,7 +126,7 @@ def partition_tests(test_ids, concurrency, repository, group_callback, # Group tests: generate group_id -> test_ids. group_ids = collections.defaultdict(list) if _group_callback is None: - group_callback = lambda _: None + group_callback = noop else: group_callback = _group_callback for test_id in test_ids: diff --git a/test-requirements.txt b/test-requirements.txt index 4f6c1147..88b398e5 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,11 +2,11 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking<0.12,>=0.11.0 # Apache-2.0 +hacking<1.2.0,>=1.1.0 sphinx!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD sphinx!=1.6.6,!=1.6.7,!=2.1.0;python_version>='3.4' # BSD mock>=2.0 # BSD subunit2sql>=1.8.0 coverage>=4.0 # Apache-2.0 ddt>=1.0.1 # MIT -doc8>=0.8.0 # Apache-2.0 \ No newline at end of file +doc8>=0.8.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 3af11eee..d4cdf3a9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.6 -envlist = py37,py36,py35,py34,py27,pep8 +envlist = py38,py37,py36,py35,py34,py27,pep8 skipsdist = True [testenv]