From a20158766b71964588deccea46b1431dcfe5c4fe Mon Sep 17 00:00:00 2001 From: David Stanek Date: Thu, 27 Mar 2014 22:47:42 +0000 Subject: First real Python 3 tests The goal of this changeset is to enable at least some of the tests to be run under Python3. Even if we can't get them all to run initially it's important that we start seeing the changes from bp keystone-py3kcompat. Also it's important that we are checking for regressions. If we do all this Python 3 work, but don't have automated tests in place we may inadvertantly undo that work. In this initial changeset I had to do some not nice things to get this to work. First I had to switch to using the nose test runner. testr seems to be much more aggressive about importing everything, even when you are not going to run the test module. This idea came from oslo. Once we have full Python 3 support we can go back to testr. Then I had to mock out some of the libraries that don't work on Python 3. This is unfortunate, but had to be done because keystone.test.core indirectly imports a significant amount of the codebase. bp python3 Change-Id: I6dd0d1b84380c4c386f70b72cdfcdf9b744c755f --- tox.ini | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tox.ini') diff --git a/tox.ini b/tox.ini index da4037e42..b2d3b7b83 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,13 @@ commands = python setup.py testr --slowest --testr-args='{posargs}' [testenv:py33] deps = -r{toxinidir}/requirements-py3.txt -r{toxinidir}/test-requirements-py3.txt -commands = python -c "import sys; print('hello from Python', sys.version_info)" + nose +commands = + nosetests \ + keystone/tests/test_cache_backend_mongo.py \ + keystone/tests/test_injection.py \ + keystone/tests/test_singular_plural.py \ + keystone/tests/unit [testenv:pep8] envdir = {toxworkdir}/venv -- cgit v1.2.1