'When the C{cProfile} module is not present,
L{app.CProfileRunner.run} should raise a C{SystemExit}
exception and log the C{ImportError}.'

def test_withoutCProfile(self):

    savedModules = sys.modules.copy()
    sys.modules['cProfile'] = None
    config = twistd.ServerOptions()
    config['profiler'] = 'cProfile'
    profiler = app.AppProfiler(config)
    try:
        self.assertRaises(SystemExit, profiler.run, None)
    finally:
        sys.modules.clear()
        sys.modules.update(savedModules)
