From 81566c7058bbb1bf0979f180af7d02147989a8aa Mon Sep 17 00:00:00 2001 From: John Siirola Date: Mon, 17 Dec 2018 12:31:17 -0700 Subject: [PATCH 1/2] Uncategorized tests should not default to expensive --- pyutilib/th/pyunit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyutilib/th/pyunit.py b/pyutilib/th/pyunit.py index ce21c046..8ce23ba9 100644 --- a/pyutilib/th/pyunit.py +++ b/pyutilib/th/pyunit.py @@ -259,7 +259,7 @@ class TestCase(unittest.TestCase): # The default test categories are 'smoke' and 'nightly' and 'expensive' smoke = 1 nightly = 1 - expensive = 1 + expensive = 0 fragile = 0 _default_categories = True # If someone specifies a category, these are the default values of From 72ff932e965fa61f6337afeb7ac5c7709533db22 Mon Sep 17 00:00:00 2001 From: John Siirola Date: Mon, 17 Dec 2018 13:56:26 -0700 Subject: [PATCH 2/2] Updating tests to reflect change in default categories --- pyutilib/dev/tests/test_runtests.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pyutilib/dev/tests/test_runtests.py b/pyutilib/dev/tests/test_runtests.py index 8f5e9337..f91abfe3 100644 --- a/pyutilib/dev/tests/test_runtests.py +++ b/pyutilib/dev/tests/test_runtests.py @@ -13,13 +13,16 @@ def _run(self, args): del os.environ['PYUTILIB_UNITTEST_CATEGORY'] stream_out = six.StringIO() pyutilib.misc.setup_redirect(stream_out) - runPyUtilibTests(['nosetests', '-v', '--no-xunit'] + args + - ['pyutilib.th.tests.test_pyunit'], - use_exec=False) + rc = runPyUtilibTests(['nosetests', '-v', '--no-xunit'] + args + + ['pyutilib.th.tests.test_pyunit'], + use_exec=False) pyutilib.misc.reset_redirect() if oldCat is not None: os.environ['PYUTILIB_UNITTEST_CATEGORY'] = oldCat + if rc: + self.fail("running nosetests failed (rc=%s)" % (rc,)) + result = [] for line in stream_out.getvalue().splitlines(): if '...' not in line: @@ -136,7 +139,7 @@ def test_expensive(self): #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_fragile', #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_fragile_smoke', #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_multi', - 'pyutilib.th.tests.test_pyunit.TestNoCategory.test_noCategory', + #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_noCategory', #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_notExpensive', #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_smoke', ] @@ -158,7 +161,7 @@ def test_expensive_AND_smoke(self): #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_fragile', #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_fragile_smoke', #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_multi', - 'pyutilib.th.tests.test_pyunit.TestNoCategory.test_noCategory', + #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_noCategory', #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_notExpensive', #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_smoke', ] @@ -202,7 +205,7 @@ def test_NOT_expensive(self): #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_fragile', #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_fragile_smoke', 'pyutilib.th.tests.test_pyunit.TestNoCategory.test_multi', - #'pyutilib.th.tests.test_pyunit.TestNoCategory.test_noCategory', + 'pyutilib.th.tests.test_pyunit.TestNoCategory.test_noCategory', 'pyutilib.th.tests.test_pyunit.TestNoCategory.test_notExpensive', 'pyutilib.th.tests.test_pyunit.TestNoCategory.test_smoke', ]