def _save_and_remove_module(name, orig_modules):
    # try to import the module and raise an error if it can't be imported
    if name not in sys.modules:
        __import__(name)
        del sys.modules[name]
    for modname in list(sys.modules):
        if modname == name or modname.startswith(name + '.'):
            orig_modules[modname] = sys.modules[modname]
            del sys.modules[modname]
Setup the TestCase class
dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/future/backports/test/support.py/_save_and_remove_module--crossover with--dataset/ETHPy150Open ofa/connect/open_connect/connectmessages/tests/__init__.py/ConnectMessageTestCase.setUpClass