70ebb197a1
Now when we are going to deprecate timeutils.set_time_override() and use mock instead, it easy to hit the following gotcha: when testr does tests discovering, it imports all modules within a given directory and it might happen that common.db.sqlalchemy.models is imported before timeutils.utcnow() is mocked in a test case. In this case the SQLAlchemy model will save the reference to the original timeutils.utcnow() function, which will be called later when the model will be saved to a DB, if created_at or updated_at value aren't provided. In order to overcome this we can defer resolution of timeutils.utcnow reference by passing lambda functions to SA Column __init__(). Related-Bug: #1266962 Change-Id: I7adce90eacb4a3f334d77da7b4a176c31ff818ed |
||
---|---|---|
doc/source | ||
etc/oslo | ||
openstack | ||
pypi | ||
tests | ||
tools | ||
.coveragerc | ||
.gitignore | ||
.gitreview | ||
.mailmap | ||
.testr.conf | ||
HACKING.rst | ||
LICENSE | ||
MAINTAINERS | ||
MANIFEST.in | ||
README.rst | ||
TESTING.rst | ||
requirements.txt | ||
run_tests.sh | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tox.ini | ||
update.py | ||
update.sh |
README.rst
The Oslo Incubator
The Oslo program produces a set of python libraries containing infrastructure code shared by OpenStack projects. The APIs provided by these libraries should be high quality, stable, consistent and generally useful.
The process of developing a new Oslo API usually begins by taking code which is common to some OpenStack projects and moving it into this repository. Incubation shouldn't be seen as a long term option for any API - it is merely a stepping stone to inclusion into a published Oslo library.
For more information, see our wiki page:
Running Tests
To run tests in virtualenvs (preferred):
sudo pip install tox tox
To run tests in the current environment:
sudo pip install -r requirements.txt nosetests
To run tests using MySQL or PostgreSQL as a DB backend do:
OS_TEST_DBAPI_ADMIN_CONNECTION=mysql://user:password@host/database tox -e py27
Note, that your DB user must have permissions to create and drop databases.