-
Notifications
You must be signed in to change notification settings - Fork 14
Add two new decorators to replace the force skip option #6091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
bbdc33c to
a02db23
Compare
|
cbeauchesne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you write some test?
By reading your code, I think it does not do what we expect (skip if it's annotated with flaky/bug/missing_feature), but inconditionally skip the test.
a02db23 to
2bf4a05
Compare
2bf4a05 to
5926ec2
Compare
| """Decorator, allow to mark a test function/class as slow to run. | ||
| Such tests are only executed if they were not deactivated | ||
| """ | ||
| return partial(_decorator, force_skip_if_xfail=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using _decorator adds a lot of needless complexity, you can simply use this :
slow = pytest.mark.skip_if_xfail
"""Decorator, allow to mark a test function/class as slow to run.
Such tests are only executed if they were not deactivated
"""
scenario_crash = pytest.mark.skip_if_xfail
"""Decorator, allow to mark a test function/class as making its scenario crash when failing.
Such tests are only executed if they were not deactivated
"""There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this works why don't we do something similar for all the decorators?
| assert True | ||
|
|
||
|
|
||
| @slow() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the usage should be simply
@slow
without the parenthesis
Motivation
Changes
Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present