From 01be20f981b592e7c4c238238c568dd091e2b226 Mon Sep 17 00:00:00 2001 From: Grzegorz Grasza Date: Wed, 24 Oct 2018 16:03:38 +0200 Subject: [PATCH] Run pep8 tox env with python3 interpreter This changes the pep8 environ to run pyflakes3 and fixes python3 compatibility errors. Change-Id: I2a57966cd60fbc54be1f07a2505ff029ab8dda41 --- novajoin/novajoin/tests/integration/test_ipa.py | 8 +++++--- tox.ini | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/novajoin/novajoin/tests/integration/test_ipa.py b/novajoin/novajoin/tests/integration/test_ipa.py index ef6eb3f..e50cc06 100644 --- a/novajoin/novajoin/tests/integration/test_ipa.py +++ b/novajoin/novajoin/tests/integration/test_ipa.py @@ -28,9 +28,11 @@ import testtools import time import uuid + from ipapython.ipa_log_manager import log_mgr from ipalib import api +import six from novajoin import config from novajoin.ipa import IPAClient @@ -60,7 +62,7 @@ class TestIPAService(testtools.TestCase): console = log_mgr.get_handler('console') console.setLevel(logging.WARN) if hostname is None: - hostname = unicode(str(uuid.uuid4()) + '.' + api.env.domain) + hostname = six.text_type(str(uuid.uuid4()) + '.' + api.env.domain) os.environ['KRB5_CONFIG'] = 'krb5.conf' def test_host_add(self): @@ -79,7 +81,7 @@ class TestIPAService(testtools.TestCase): def test_host_subhost(self): global hostname - subhost = unicode(str(uuid.uuid4()) + '.' + api.env.domain) + subhost = six.text_type(str(uuid.uuid4()) + '.' + api.env.domain) self.ipaclient.add_subhost(subhost) self.ipaclient.flush_batch_operation() @@ -103,7 +105,7 @@ class TestIPAService(testtools.TestCase): ipaotp = str(uuid.uuid4()) metadata = {} image_metadata = {} - subhost = unicode(str(uuid.uuid4()) + '.' + api.env.domain) + subhost = six.text_type(str(uuid.uuid4()) + '.' + api.env.domain) service_principal = u'test/%s' % subhost self.ipaclient.add_host(hostname, ipaotp, metadata, image_metadata) self.ipaclient.add_host(subhost, ipaotp, metadata, image_metadata) diff --git a/tox.ini b/tox.ini index 74f640b..cd4bb1d 100644 --- a/tox.ini +++ b/tox.ini @@ -29,6 +29,7 @@ whitelist_externals = passenv = *_proxy *_PROXY [testenv:pep8] +basepython = python3 commands = flake8 {posargs} . {toxinidir}/tools/check_exec.py {toxinidir}/novajoin @@ -66,4 +67,3 @@ commands = sphinx-build -W -b html doc/source doc/build/html sitepackages = False envdir = {toxworkdir}/pep8 commands = oslo-config-generator --config-file=files/novajoin-config-generator.conf -