registry.call_hook("before", "harvest", locals()) results = [] try: for path in paths: app_module = None if isinstance(path, tuple) and len(path) is 2: path, app_module = path if app_module is not None: registry.call_hook("before_each", "app", app_module) runner = Runner(path, options.get("scenarios"), verbosity) result = runner.run() if app_module is not None: registry.call_hook("after_each", "app", app_module, result) results.append(result) if not result or result.steps != result.steps_passed: failed = True except Exception, e: import traceback traceback.print_exc(e) finally: registry.call_hook("after", "harvest", results) server.stop(failed) teardown_test_environment()
app_module = None if isinstance(path, tuple) and len(path) is 2: path, app_module = path if app_module is not None: registry.call_hook('before_each', 'app', app_module) runner = Runner(path, options.get('scenarios'), verbosity, enable_xunit=options.get('enable_xunit'), xunit_filename=options.get('xunit_file'), wait=wait) result = runner.run() if app_module is not None: registry.call_hook('after_each', 'app', app_module, result) results.append(result) if not result or result.steps != result.steps_passed: failed = True except SystemExit, e: exit_code = e.code except Exception, e: import traceback traceback.print_exc(e) finally: registry.call_hook('after', 'harvest', results) teardown_test_environment() if failed and exit_code == 0: exit_code = 1 server.stop(exit_code)
if app_module is not None: registry.call_hook("before_each", "app", app_module) runner = Runner(path, options.get("scenarios"), verbosity) result = runner.run() if app_module is not None: registry.call_hook("after_each", "app", app_module, result) results.append(result) if not result or result.steps != result.steps_passed: failed = True except Exception, e: import traceback traceback.print_exc(e) finally: registry.call_hook("after", "harvest", results) if run_server: server.stop() if use_test_database: connection.creation.destroy_test_db(test_database, verbosity=1) teardown_test_environment() return sys.exit(0)
registry.call_hook('before', 'harvest', locals()) results = [] try: for path in paths: app_module = None if isinstance(path, tuple) and len(path) is 2: path, app_module = path if app_module is not None: registry.call_hook('before_each', 'app', app_module) runner = Runner(path, options.get('scenarios'), verbosity, enable_xunit=options.get('enable_xunit'), xunit_filename=options.get('xunit_file')) result = runner.run() if app_module is not None: registry.call_hook('after_each', 'app', app_module, result) results.append(result) if not result or result.steps != result.steps_passed: failed = True except Exception, e: import traceback traceback.print_exc(e) finally: registry.call_hook('after', 'harvest', results) server.stop(failed) teardown_test_environment()