From 3d49f22494efca93c8f7d1a191dc5000864b54fc Mon Sep 17 00:00:00 2001 From: Sebastian Kalinowski Date: Thu, 25 Jun 2015 20:42:21 +0200 Subject: [PATCH] Change testrunner to py.test py.test is used in many of our projects and much more advanced than testrepository also it allowed to catch a small bug - driver do not work on a copy of a data so it modifies it also for other components Change-Id: I1273383d7e5aba110b5c74cd66095afd6e226a42 Implements: blueprint volume-manager-refactoring --- fuel_agent/fuel_agent/drivers/base.py | 4 +++- fuel_agent/test-requirements.txt | 3 ++- fuel_agent/tox.ini | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fuel_agent/fuel_agent/drivers/base.py b/fuel_agent/fuel_agent/drivers/base.py index 9ce4224a86..77003f990e 100644 --- a/fuel_agent/fuel_agent/drivers/base.py +++ b/fuel_agent/fuel_agent/drivers/base.py @@ -13,6 +13,8 @@ # limitations under the License. import abc +import copy + import six @@ -25,4 +27,4 @@ class BaseDataDriver(object): """ def __init__(self, data): - self.data = data + self.data = copy.deepcopy(data) diff --git a/fuel_agent/test-requirements.txt b/fuel_agent/test-requirements.txt index 1ad9300d6c..5577c4b23e 100644 --- a/fuel_agent/test-requirements.txt +++ b/fuel_agent/test-requirements.txt @@ -2,4 +2,5 @@ hacking>=0.8.0,<0.9 mock>=1.0 oslotest==1.0 testtools>=0.9.34 -testrepository>=0.0.18 +pytest>=2.7.2 +pytest-cov>=1.8.1 diff --git a/fuel_agent/tox.ini b/fuel_agent/tox.ini index b54b3fea69..7c849fe59d 100644 --- a/fuel_agent/tox.ini +++ b/fuel_agent/tox.ini @@ -10,7 +10,7 @@ setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = - python setup.py testr --slowest --testr-args='{posargs:}' + py.test -vv {posargs:fuel_agent/tests} [tox:jenkins] downloadcache = ~/cache/pip @@ -23,7 +23,7 @@ commands = [testenv:cover] setenv = VIRTUAL_ENV={envdir} commands = - python setup.py testr --coverage {posargs:fuel_agent} + py.test --cov fuel_agent {posargs:fuel_agent/tests} [testenv:venv] commands = {posargs:}