Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncategorized tests should not default to expensive #46

Merged
merged 2 commits into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions pyutilib/dev/tests/test_runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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',
]
Expand All @@ -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',
]
Expand Down Expand Up @@ -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',
]
Expand Down
2 changes: 1 addition & 1 deletion pyutilib/th/pyunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down