diff --git a/HACKING.rst b/HACKING.rst index 0423c41e1..4333d2568 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -66,9 +66,9 @@ Example:: import random import StringIO import time - import unittest import eventlet + import testtools import webob.exc import quantum.api.networks @@ -199,6 +199,12 @@ bug that had no unit test, a new passing unit test should be added. If a submitted bug fix does have a unit test, be sure to add a new one that fails without the patch and passes with the patch. +All unittest classes must ultimately inherit from testtools.TestCase. +All setUp and tearDown methods must upcall using the super() method. +tearDown methods should be avoided and addCleanup calls should be preferred. +Never manually create tempfiles. Always use the tempfile fixtures from +the fixture library to ensure that they are cleaned up. + openstack-common ---------------- diff --git a/setup.cfg b/setup.cfg index 565cba388..55e13ead0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,7 +9,6 @@ source-dir = doc/source # tissue http://pypi.python.org/pypi/tissue (pep8 checker) # openstack-nose https://github.com/jkoelker/openstack-nose verbosity=2 -detailed-errors=1 cover-package = quantum cover-html = true cover-erase = true diff --git a/tools/test-requires b/tools/test-requires index 0f7f2acd6..d86688ea4 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -2,6 +2,7 @@ Babel>=0.9.6 cliff coverage distribute>=0.6.24 +fixtures>=0.3.12 mock>=1.0b1 mox==0.5.3 nose @@ -10,7 +11,7 @@ nosexcover openstack.nose_plugin pep8 sphinx>=1.1.2 -unittest2 +testtools>=0.9.27 webtest==1.3.3 # Packages for the Cisco Plugin ###############################