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
This commit is contained in:
Mark McLoughlin 2013-08-08 23:13:55 +01:00
parent 464efedfdd
commit bcb3096041
4 changed files with 16 additions and 3 deletions

15
oslo/version/__init__.py Normal file
View File

@ -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.

View File

@ -19,8 +19,8 @@ import os
import fixtures
from oslo.version import tests
from oslo.version import version
import tests
class DeferredVersionTestCase(tests.BaseTestCase):

View File

@ -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