Revert "Use common tools to run tests"
This reverts commit a9e5b7644a
.
Change-Id: I67ddedcb100a52e82ce6bfd39fabaff33d33d0c3
Related-Bug: #1555577
This commit is contained in:
parent
a9e5b7644a
commit
4283dd3bab
|
@ -12,8 +12,8 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslotest import base as oslo_base
|
||||
from unittest2.case import TestCase
|
||||
|
||||
|
||||
class BaseTestCase(oslo_base.BaseTestCase):
|
||||
class BaseTestCase(TestCase):
|
||||
"""Base unit test case for shotgun tests."""
|
||||
|
|
|
@ -258,8 +258,6 @@ class TestFile(base.BaseTestCase):
|
|||
|
||||
class TestCommand(base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestCommand, self).setUp()
|
||||
|
||||
self.conf = mock.Mock()
|
||||
self.conf.target = '/some/dir'
|
||||
|
||||
|
@ -352,8 +350,6 @@ class TestCommand(base.BaseTestCase):
|
|||
|
||||
class TestDockerCommand(base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestDockerCommand, self).setUp()
|
||||
|
||||
self.conf = mock.Mock()
|
||||
self.conf.target = '/some/dir'
|
||||
|
||||
|
|
|
@ -151,8 +151,8 @@ class TestManager(base.BaseTestCase):
|
|||
conf.lastdump = tempfile.mkstemp()[1]
|
||||
conf.self_log_object = {"type": "file", "path": "/path"}
|
||||
manager = Manager(conf)
|
||||
|
||||
self.assertRaises(IOError, manager.snapshot)
|
||||
with self.assertRaises(IOError):
|
||||
manager.snapshot()
|
||||
calls = [mock.call('/target', onerror=mock.ANY) for _ in range(2)]
|
||||
mrmtree.assert_has_calls(calls)
|
||||
|
||||
|
@ -175,6 +175,6 @@ class TestManager(base.BaseTestCase):
|
|||
conf.lastdump = tempfile.mkstemp()[1]
|
||||
conf.self_log_object = {"type": "file", "path": "/path"}
|
||||
manager = Manager(conf)
|
||||
|
||||
self.assertRaises(IOError, manager.snapshot)
|
||||
with self.assertRaises(IOError):
|
||||
manager.snapshot()
|
||||
mrmtree.assert_called_once_with('/target', onerror=mock.ANY)
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# The order of packages is significant, because pip processes them in the order
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
hacking<0.11,>=0.10.2 # Apache-2.0
|
||||
coverage>=3.6 # Apache-2.0
|
||||
os-testr>=0.4.1 # Apache-2.0
|
||||
oslotest>=1.10.0 # Apache-2.0
|
||||
mock>=1.2 # BSD
|
||||
unittest2 # BSD
|
||||
|
||||
# Packages beyond this line are not in Global Requirements list
|
||||
# and must be added there.
|
||||
pytest==2.8.0
|
||||
pytest-cov==2.1.0
|
||||
|
|
7
tox.ini
7
tox.ini
|
@ -10,16 +10,18 @@ setenv = VIRTUAL_ENV={envdir}
|
|||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
ostestr {posargs}
|
||||
py.test -vv {posargs:shotgun/test}
|
||||
|
||||
[testenv:pep8]
|
||||
deps = hacking==0.10
|
||||
usedevelop = False
|
||||
commands =
|
||||
flake8 {posargs:shotgun}
|
||||
|
||||
[testenv:cover]
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
commands =
|
||||
python setup.py test --coverage {posargs}
|
||||
py.test -vv --cov=shotgun {posargs:shotgun/test}
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs:}
|
||||
|
@ -29,6 +31,7 @@ envdir = devenv
|
|||
usedevelop = True
|
||||
|
||||
[flake8]
|
||||
ignore = H234,H302,H802
|
||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,__init__.py,docs
|
||||
show-pep8 = True
|
||||
show-source = True
|
||||
|
|
Loading…
Reference in New Issue