{"action":"opened","issue":{"url":"https://api.github.com/repos/behave/behave/issues/385","labels_url":"https://api.github.com/repos/behave/behave/issues/385/labels{/name}","comments_url":"https://api.github.com/repos/behave/behave/issues/385/comments","events_url":"https://api.github.com/repos/behave/behave/issues/385/events","html_url":"https://github.com/behave/behave/issues/385","id":123334836,"number":385,"title":"before_scenario called too late","user":{"login":"BRevzin","id":13238276,"avatar_url":"https://avatars.githubusercontent.com/u/13238276?v=3","gravatar_id":"","url":"https://api.github.com/users/BRevzin","html_url":"https://github.com/BRevzin","followers_url":"https://api.github.com/users/BRevzin/followers","following_url":"https://api.github.com/users/BRevzin/following{/other_user}","gists_url":"https://api.github.com/users/BRevzin/gists{/gist_id}","starred_url":"https://api.github.com/users/BRevzin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BRevzin/subscriptions","organizations_url":"https://api.github.com/users/BRevzin/orgs","repos_url":"https://api.github.com/users/BRevzin/repos","events_url":"https://api.github.com/users/BRevzin/events{/privacy}","received_events_url":"https://api.github.com/users/BRevzin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-21T18:40:41Z","updated_at":"2015-12-21T18:40:41Z","closed_at":null,"body":"In `Scenario.run()`, the `before_scenario` hook is called *after* the formatters start formatting the scenario:\r\n\r\n        if run_scenario or runner.config.show_skipped:\r\n            for formatter in runner.formatters:\r\n                formatter.scenario(self)\r\n\r\n        runner.context._push()\r\n        runner.context.scenario = self \r\n        runner.context.tags = set(self.effective_tags)\r\n\r\n        hooks_called = False\r\n        if not runner.config.dry_run and run_scenario:\r\n            hooks_called = True \r\n            for tag in self.tags:\r\n                runner.run_hook('before_tag', runner.context, tag) \r\n            runner.run_hook('before_scenario', runner.context, self)\r\n            ...\r\n\r\nSo if I, in `before_scenario`, want to use the active tags to `skip()` the scenario, and am running with `--no-skipped`, I will still see the result of `formatter.scenario(self)` logged. We should call the hooks first, *then* check `run_scenario` to do the formatting. "}}