Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

KeyboardInterrupt and after_each.* hooks #376

Open
rtkrruvinskiy opened this Issue Aug 26, 2013 · 0 comments

Comments

Projects
None yet
1 participant
Contributor

rtkrruvinskiy commented Aug 26, 2013

Currently, if lettuce is interrupted using Ctrl-C and a KeyboardInterrupt exception is raised, lettuce exits but does not run any after_each.scenario or after_each.feature hook unless failfast is true. The same would hold for any exception that inherits from BaseException but not from Exception (i.e., an exception which would not be caught by the 'except Exception, e:' clause in Step.run_all but would be caught by the 'except:' clauses in Scenario.run and Feature.run). I suspect this behaviour is not what is expected, but I wanted to confirm.

I would expect that, regardless of whether failfast is set, if the scenario or feature execution is aborted, the corresponding after hook runs. I think taking out the 'if failsafe:' guards for running the hooks in Feature.run and Scenario.run would result in the correct behaviour. Is my train of thought correct? If it is, I can submit a pull request if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment