-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
test: autouse app_context in unit tests #20911
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20911 +/- ##
==========================================
- Coverage 66.29% 65.60% -0.70%
==========================================
Files 1758 1758
Lines 67010 67010
Branches 7107 7107
==========================================
- Hits 44426 43960 -466
- Misses 20762 21228 +466
Partials 1822 1822
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. |
79f8641
to
e0dc6be
Compare
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.
Looks good
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.
This is awesome!
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.
@ktmud you might want to remove the importing of AppContext
—used for typing in the tests. Sadly if CI is passing it means we likely aren't running Pylint in the tests.
@john-bodley I didn't find any more imports of |
(cherry picked from commit 7e836e9)
SUMMARY
I have yet to see a test case where having an app_context is troublesome. Since it's fairly cheap to create a new context, we can just autouse the
app_context
fixture to save some boilerplate code.Doing this for integration tests may have more complications. Will try it in another PR.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
CI
ADDITIONAL INFORMATION