From ac94d901a2a1b9fc8683b44adeec2d3d6f9fa5bb Mon Sep 17 00:00:00 2001 From: Michal Minar Date: Wed, 8 Jan 2014 16:14:48 +0100 Subject: tests: ensure the use of exceptions is well defined Some tests expect that exceptions won't be thrown out of LMIShell's functions. Others prefers them and enable them globally. This causes problems when running under nosetests all provider tests at once. Tests that modified enablement of exception throws globally caused others to fail. This patch makes sure that each TestCase has defined use of exceptions. Default state is to have them disabled. If a TestCase prefers having them enabled, just one variable needs to be overriden in its body: class AccountBase(lmibase.LmiTestCase): USE_EXCEPTIONS = True --- src/journald/test/journald_common.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/journald/test') diff --git a/src/journald/test/journald_common.py b/src/journald/test/journald_common.py index 60ce15e..bf89595 100644 --- a/src/journald/test/journald_common.py +++ b/src/journald/test/journald_common.py @@ -22,14 +22,11 @@ Base class and utilities for Journald tests. """ from lmi.test import lmibase -import lmi.shell class JournalBase(lmibase.LmiTestCase): """ Base class for all LMI Journal tests """ - @classmethod - def setUpClass(cls): - lmibase.LmiTestCase.setUpClass.im_func(cls) - lmi.shell.LMIUtil.lmi_set_use_exceptions(True) + USE_EXCEPTIONS = True + -- cgit