Skip to content

Commit

Permalink
Run global (all) level callbacks at a proper time
Browse files Browse the repository at this point in the history
  • Loading branch information
koterpillar committed May 30, 2015
1 parent 9012d3c commit b513995
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion aloe/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,15 @@ def loadTestsFromFile(self, file_):

test = self.test_class.from_file(file_)

self.ensure_before_callbacks()

# Filter the scenarios, if asked
for scenario_index, scenario_name in test.scenarios():
if not self.scenario_indices or \
scenario_index in self.scenario_indices:
yield test(scenario_name)

def startTest(self, test):
def ensure_before_callbacks(self):
"""
Before the first test, run the "before all" callbacks.
"""
Expand Down
5 changes: 1 addition & 4 deletions tests/functional/test_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def wrap(type_, *inner_event_lists):
wrap(
'example',
wrap('step'),
wrap('step'),
),
),
wrap(
Expand All @@ -189,13 +188,11 @@ def wrap(type_, *inner_event_lists):
wrap(
'example',
wrap('step'),
wrap('step'),
),
),
)

print(world.types)
print(expected)

assert_equal(tuple(world.types), expected)

def test_behave_as(self):
Expand Down

0 comments on commit b513995

Please sign in to comment.