You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using nested hooks, mamba executes the whole stack of hooks instead of only the hooks in the current scope. See the MWE for more details. This problem is also present with the after.all hook.
spec.py:
frommambaimportbefore, description, itfromexpectsimport*num_outer_called=0num_inner_called=0withdescription('Bug'):
withbefore.all:
globalnum_outer_callednum_outer_called+=1print('outer.before.all')
withit('should have run before.all once'):
expect(num_outer_called).to(equal(1))
withdescription('when having a nested before.all'):
withbefore.all:
globalnum_inner_callednum_inner_called+=1print('inner.before.all')
withit('should have run the inner before.all once'):
expect(num_inner_called).to(equal(1))
withit('should have still run the outer before.all only once'):
expect(num_outer_called).to(equal(1)) # Failed with 'expected: 2 to equal 1'
The text was updated successfully, but these errors were encountered:
When using nested hooks, mamba executes the whole stack of hooks instead of only the hooks in the current scope. See the MWE for more details. This problem is also present with the after.all hook.
spec.py:
The text was updated successfully, but these errors were encountered: