From 38ee2340d9de4e193278d353c5fc394ce945e6f1 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Thu, 13 Aug 2015 14:51:13 +0200 Subject: [PATCH] Add func3 tox environment for functional testing with Python 3. It's the same as func, but runs functional tests with Python 3. One issue was fixed in ironic_inspector.test.functional. Change-Id: I6a081ad2ca8857018c6b531ed82182aab0ccca4d --- ironic_inspector/test/functional.py | 3 ++- tox.ini | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ironic_inspector/test/functional.py b/ironic_inspector/test/functional.py index 17dfe80..fc92aa5 100644 --- a/ironic_inspector/test/functional.py +++ b/ironic_inspector/test/functional.py @@ -171,7 +171,8 @@ def mocked_server(): conf_file = os.path.join(d, 'test.conf') db_file = os.path.join(d, 'test.db') with open(conf_file, 'wb') as fp: - fp.write(CONF % {'db_file': db_file}) + content = CONF % {'db_file': db_file} + fp.write(content.encode('utf-8')) with mock.patch.object(utils, 'check_auth'): with mock.patch.object(utils, 'get_client'): diff --git a/tox.ini b/tox.ini index 540caf8..d1ad59f 100644 --- a/tox.ini +++ b/tox.ini @@ -27,6 +27,11 @@ basepython = python2.7 commands = python -m ironic_inspector.test.functional +[testenv:func3] +basepython = python3.4 +commands = + python3 -m ironic_inspector.test.functional + [testenv:genconfig] envdir = {toxworkdir}/venv commands =