@@ -0,0 +1,2601 @@
+'''%0A    %3E%3E%3E ExecutingSnippetAfterAllScenarios.run()%0A    True%0A    %3E%3E%3E print output.getvalue()%0A    Story: Executing snippet after all scenarios%0A      As a smart dev%0A      I want to execute some snippet after scenarios%0A      So that I can clean the env created by before_steps%0A    %3CBLANKLINE%3E%0A      Scenario 1: Scenario change name%0A        Given My name is Gabriel   ... OK%0A        When I change my name to Joao   ... OK%0A        Then My name is Joao   ... OK%0A    %3CBLANKLINE%3E%0A      Ran 1 scenario with 0 failures, 0 errors and 0 pending steps%0A    %3CBLANKLINE%3E%0A    %3E%3E%3E ExecutingSnippetAfterEachScenario.run()%0A    True%0A    %3E%3E%3E print output2.getvalue()%0A    Story: Executing snippet after each scenario%0A      As a smart dev%0A      I want to execute some snippet after each scenario%0A      So that I can clean the env created by before_steps%0A    %3CBLANKLINE%3E%0A      Scenario 1: Scenario only to change name%0A        When I change my name to Joao   ... OK%0A    %3CBLANKLINE%3E%0A      Ran 1 scenario with 0 failures, 0 errors and 0 pending steps%0A    %3CBLANKLINE%3E%0A'''%0A%0A%0Afrom pyhistorian import *%0Afrom should_dsl import *%0Afrom cStringIO import StringIO%0A%0Aoutput = StringIO()%0Aoutput2 = StringIO()%0A%0Aclass ScenarioChangeName(Scenario):%0A    @Given('My name is Gabriel')%0A    def name_equal_gabriel(self):%0A        self.name %7Cshould_be.equal_to%7C %22Gabriel%22%0A    %0A    @When('I change my name to Joao')%0A    def change_name_to_joao(self):%0A        self.name = 'Joao'%0A%0A    @Then('My name is Joao')%0A    def check_for_hugo(self):%0A        self.name %7Cshould_be.equal_to%7C 'Joao'%0A%0Aclass ExecutingSnippetAfterAllScenarios(Story):%0A    '''%0A      As a smart dev%0A      I want to execute some snippet after scenarios%0A      So that I can clean the env created by before_steps%0A    '''%0A    output = output%0A    colored = False%0A%0A    scenarios = %5BScenarioChangeName,%5D%0A%0A    def before_all(self, context):%0A        context.name = 'Gabriel'%0A%0A    def after_all(self, context):%0A        context.name %7Cshould_be.equal_to%7C 'Joao'%0A%0Aclass ScenarioOnlyToChangeName(Scenario):%0A    %0A    @When('I change my name to Joao')%0A    def change_name_to_joao(self):%0A        self.name %7Cshould_be.equal_to%7C 'Gabriel'%0A        self.name = 'Joao'%0A%0Aclass ExecutingSnippetAfterEachScenario(Story):%0A    '''%0A      As a smart dev%0A      I want to execute some snippet after each scenario%0A      So that I can clean the env created by before_steps%0A    '''%0A    output = output2%0A    colored = False%0A%0A    scenarios = %5BScenarioOnlyToChangeName,%5D%0A%0A    def before_each(self, context):%0A        context.name = 'Gabriel'%0A%0A    def after_each(self, context):%0A        context.name %7Cshould_be.equal_to%7C 'Joao'%0A

add test to validate after_all and after_eachw