From 85b222cffefc307c7ca0c82477c10ec9ee006035 Mon Sep 17 00:00:00 2001 From: Nguyen Hung Phuong Date: Mon, 9 Jul 2018 14:29:59 +0700 Subject: [PATCH] fix tox python3 overrides We want to default to running all tox environments under python 3, so set the basepython value in each environment. We do not want to specify a minor version number, because we do not want to have to update the file every time we upgrade python. We do not want to set the override once in testenv, because that breaks the more specific versions used in default environments like py35 and py36. Change-Id: I45a7155785ce37dbeb8c77d409437d65bcdc479b --- scripts/marathon-health-check-testing/HealthCheckBencher.py | 3 ++- tox.ini | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/marathon-health-check-testing/HealthCheckBencher.py b/scripts/marathon-health-check-testing/HealthCheckBencher.py index 3fabe4d..daf8245 100755 --- a/scripts/marathon-health-check-testing/HealthCheckBencher.py +++ b/scripts/marathon-health-check-testing/HealthCheckBencher.py @@ -13,6 +13,7 @@ from marathon.models import MarathonHealthCheck from Queue import Empty from Queue import Queue from random import random +import six from threading import Thread from time import sleep from urllib2 import urlopen @@ -198,7 +199,7 @@ class HealthCheckBencher(object): def start_test(self): task_list = self.get_tasks() for action in self.action_list: - if isinstance(action, basestring): + if isinstance(action, six.text_type): if action.startswith('sleep='): amount = int(action.split('=')[1]) sleep(60*amount) diff --git a/tox.ini b/tox.ini index 189de06..3a3fecb 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,6 @@ skipsdist = True [testenv] usedevelop = True -basepython = python2.7 # --ignore-installed is added to workaround problem with pip 8.0 and argparse # https://github.com/pypa/pip/issues/3404 and # https://github.com/pypa/pip/issues/3384 @@ -21,12 +20,15 @@ commands = python setup.py test --slowest --testr-args='{posargs}' [testenv:venv] +basepython = python3 commands = {posargs} [testenv:pep8] +basepython = python3 commands = flake8 [testenv:docs] +basepython = python3 commands = python setup.py build_sphinx