summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2013-08-08 23:13:55 +0100
committerMark McLoughlin <markmc@redhat.com>2013-10-21 12:01:08 +0100
commitbcb309604185502bbc0f16a395abf8081bd7ae22 (patch)
tree16fa75c078f36ed737f2b601e4d603447e9d7cbe
parent464efedfdd68c1a1ed4dae6fdb01bbce9c34b8da (diff)
downloadoslo-version-bcb309604185502bbc0f16a395abf8081bd7ae22.tar.gz
Make the tests actually run
Firstly, add a missing oslo/version/__init__.py. Secondly, move tests from oslo/version/tests/ to tests/ Having the tests under oslo.version and using oslo.sphinx in the same virtual env doesn't seem to work. The issue appears to be that because the tests don't get installed under the namespace package in the venv's site-packages, testr can't find them. Personally, I'm a fan of keeping tests in a different directory from the runtime code and this is what works for oslo.config and oslo.messaging. Thirdly, avoid using 'setup.py develop' with tox. There seems to be an issue with the 'setup.py develop' approach caused by the fact that oslo is a namespace package and we install oslo.sphinx into this namespace in the virtualenv. This results in the oslo.version package not being found when it's not properly installed into the virtualenv. These really should be three separate commits, but any one of them alone causes testr to stop pretending everything is fine so they all need to be merged together. Closes-Bug: #1242614 Change-Id: I5140fa62dc8bdd10a58bd2847b27514a926e3c19
-rw-r--r--oslo/version/__init__.py15
-rw-r--r--tests/__init__.py (renamed from oslo/version/tests/__init__.py)0
-rw-r--r--tests/test_version.py (renamed from oslo/version/tests/test_version.py)2
-rw-r--r--tox.ini2
4 files changed, 16 insertions, 3 deletions
diff --git a/oslo/version/__init__.py b/oslo/version/__init__.py
new file mode 100644
index 0000000..30ed0a7
--- /dev/null
+++ b/oslo/version/__init__.py
@@ -0,0 +1,15 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
diff --git a/oslo/version/tests/__init__.py b/tests/__init__.py
index d850631..d850631 100644
--- a/oslo/version/tests/__init__.py
+++ b/tests/__init__.py
diff --git a/oslo/version/tests/test_version.py b/tests/test_version.py
index 09a70f5..031302e 100644
--- a/oslo/version/tests/test_version.py
+++ b/tests/test_version.py
@@ -19,8 +19,8 @@ import os
import fixtures
-from oslo.version import tests
from oslo.version import version
+import tests
class DeferredVersionTestCase(tests.BaseTestCase):
diff --git a/tox.ini b/tox.ini
index 3d8491c..fc54f73 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,10 +1,8 @@
[tox]
minversion = 1.6
-skipsdist = True
envlist = py26,py27,pypy,pep8
[testenv]
-usedevelop = True
install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8