From db2ee4b4e890ff292eba98a800b70a0e106a05aa Mon Sep 17 00:00:00 2001 From: Lingxian Kong Date: Thu, 11 Feb 2016 16:02:05 +1300 Subject: [PATCH] Update tox configuration Change usage of unittest.skip() to testtools.skip() Change-Id: Id3283805dfcb7856dc7bec3dcf19f1557184ec09 --- .testr.conf | 4 ++++ distil/tests/unit/test_api.py | 9 +++++---- tox.ini | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .testr.conf diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 0000000..90d92dd --- /dev/null +++ b/.testr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_command=${PYTHON:-python} -m subunit.run discover ./distil/tests/unit -t . $LISTOPT $IDOPTION +test_id_option=--load-list $IDFILE +test_list_option=--list diff --git a/distil/tests/unit/test_api.py b/distil/tests/unit/test_api.py index 1050abe..0f2b4d2 100644 --- a/distil/tests/unit/test_api.py +++ b/distil/tests/unit/test_api.py @@ -24,9 +24,9 @@ from distil.helpers import convert_to from distil.constants import dawn_of_time from datetime import datetime from decimal import Decimal -import unittest import json import mock +import testtools class TestAPI(test_interface.TestInterface): @@ -42,7 +42,7 @@ class TestAPI(test_interface.TestInterface): super(TestAPI, self).tearDown() self.app = None - @unittest.skip + @testtools.skip("skip test.") def test_usage_run_for_all(self): """Asserts a usage run generates data for all tenants""" @@ -84,7 +84,7 @@ class TestAPI(test_interface.TestInterface): self.assertEquals(resources.count(), len(usage.values())) - @unittest.skip + @testtools.skip("skip test.") def test_memcache_raw_usage(self): """Tests that raw usage queries are cached, and returned.""" numTenants = 1 @@ -124,7 +124,7 @@ class TestAPI(test_interface.TestInterface): self.assertEquals(1, len(values)) self.assertEquals(resp2.body, test_string) - @unittest.skip + @testtools.skip("skip test.") def test_memcache_rated_usage(self): """Tests that rated usage queries are cached, and returned.""" numTenants = 1 @@ -270,6 +270,7 @@ class TestAPI(test_interface.TestInterface): self.assertEquals(tenant_dict['total_cost'], str(0)) + @testtools.skip("skip test.") def test_get_last_collected(self): """test to ensure last collected api call returns correctly""" now = datetime.now() diff --git a/tox.ini b/tox.ini index 7b35c56..dc447b3 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ setenv = deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = python setup.py test --slowest --testr-args="{posargs}" +commands = python setup.py testr --slowest --testr-args="{posargs}" whitelist_externals = bash [testenv:py33]