-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip decorator: apply skip dynamic conditions to setUp()
There's currently a bug in cause by the fact that the decorator function is always marked (__skip_method_decorator__) to be skipped, even when the condition is supposed to be evaluated later, during the execution of the decorator. This has caused the setUp() method to not be executed in certain cases, and the test method proceeds without finding its environment set up (common situation when not running setUp(), one ends up with missing attributes, in the class and cryptic errors during the execution of the test). This evaluates the same conditions used for skipping the test, but also for skipping the setUp() method. Unfortunately, we have to distinguish between the condition and the decorator itself because if we don't, we may end up running the decorated function (usually the test) twice. Signed-off-by: Cleber Rosa <crosa@redhat.com>
- Loading branch information
Showing
3 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters