BF: avoid circular imports -- import testcases right in gatherTests

pull/218/head
Yaroslav Halchenko 2013-05-08 13:54:11 -04:00
parent f1b6806eb4
commit b86d8e9565
1 changed files with 11 additions and 9 deletions

View File

@ -120,6 +120,9 @@ def tearDownMyTime():
time.tzset()
MyTime.myTime = None
def gatherTests(regexps=None, no_network=False):
# Import all the test cases here instead of a module level to
# avoid circular imports
from fail2ban.tests import banmanagertestcase
from fail2ban.tests import clientreadertestcase
from fail2ban.tests import failmanagertestcase
@ -129,7 +132,6 @@ from fail2ban.tests import datedetectortestcase
from fail2ban.tests import actiontestcase
from fail2ban.tests import sockettestcase
def gatherTests(regexps=None, no_network=False):
if not regexps: # pragma: no cover
tests = unittest.TestSuite()
else: # pragma: no cover