Fix regression test import issue.

pull/3/head
Navnath Gadakh 2016-10-13 06:49:33 -07:00 committed by Dave Page
parent c2cd2d3d3b
commit 36c185e9dc
1 changed files with 2 additions and 11 deletions

View File

@ -53,15 +53,6 @@ class TestsGeneratorRegistry(ABCMeta):
ABCMeta.__init__(cls, name, bases, d)
@staticmethod
def import_app_modules(module_name):
"""As we are running test suite for each server. To catch
the test cases, delete the previously imported module
"""
if str(module_name) in sys.modules.keys():
del sys.modules[module_name]
import_module(module_name)
@classmethod
def load_generators(cls, pkg):
@ -72,7 +63,7 @@ class TestsGeneratorRegistry(ABCMeta):
for module_name in find_modules(pkg, False, True):
try:
if "tests." in str(module_name):
cls.import_app_modules(module_name)
import_module(module_name)
except ImportError:
traceback.print_exc(file=sys.stderr)
else:
@ -81,7 +72,7 @@ class TestsGeneratorRegistry(ABCMeta):
# Exclude the test cases in browser node if SERVER_MODE
# is False
if "pgadmin.browser.tests" not in module_name:
cls.import_app_modules(module_name)
import_module(module_name)
except ImportError:
traceback.print_exc(file=sys.stderr)