#853 Unintuitive multiple execution of virtual setup/teardown

framework (182)

If a base class defines setup and tear down as virtual, and a derived class overrides these methods, and both apply the attribute, the function is executed twice.
I think it would be nice if the framework was a little smarter and recognized that the two setup tags infact refer to the same method, since it is virtual/override pair and only run it once.


  • Charlie Poole

    Charlie Poole - 2009-07-26

    This seems to be a user error. Overriding implies that the override should be run in lieu of the overridden method. Marking both methods with an attribute implies that
    they should both be run.

    If there is a sensible use case for wanting to do this, we can re-open the bug.

  • Charlie Poole

    Charlie Poole - 2009-07-26
    • status: open --> closed-rejected
  • Nobody/Anonymous

    Well given that you Must have the attribute on the base class, since it may not be overridden, the only other option is to not have it on any derived classes.

    This is okay, but I think it decreases the obviousness to users reading the code that the method is an actual working setup or teardown method.

  • Nobody/Anonymous

    Nevermind - scenario tested was not scenario reported - it seems it already works as I expected.


Log in to post a comment.