@contextmanager
def _create_app(request, enable_logging=False, use_trap=False, parameters={}, **config):
 test_app = TestApp(set_as_current=False, enable_logging=enable_logging, config=config, **parameters)
 _module = getattr(request, u'module', None)
 _cls = getattr(request, u'cls', None)
 _function = getattr(request, u'function', None)
 with setup_default_app(test_app, use_trap=use_trap):
  is_not_contained = any([(not getattr(_module, u'app_contained', True)), (not getattr(_cls, u'app_contained', True)), (not getattr(_function, u'app_contained', True))])
  if is_not_contained:
   test_app.set_current()
  (yield test_app)

@ contextmanager def _create_app ( request , enable_logging = False , use_trap = False , parameters = { } , ** config ) : test_app = TestApp ( set_as_current = False , enable_logging = enable_logging , config = config , ** parameters ) _module = getattr ( request , u'module' , None ) _cls = getattr ( request , u'cls' , None ) _function = getattr ( request , u'function' , None ) with setup_default_app ( test_app , use_trap = use_trap ) : is_not_contained = any ( [ ( not getattr ( _module , u'app_contained' , True ) ) , ( not getattr ( _cls , u'app_contained' , True ) ) , ( not getattr ( _function , u'app_contained' , True ) ) ] ) if is_not_contained : test_app . set_current ( ) ( yield test_app )
utility context used to setup celery app for pytest fixtures .