-
Notifications
You must be signed in to change notification settings - Fork 8
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
tests: fix environment not being replaced soon enough #126
Conversation
Codecov Report
@@ Coverage Diff @@
## main #126 +/- ##
==========================================
- Coverage 70.90% 70.52% -0.39%
==========================================
Files 33 33
Lines 1619 1632 +13
Branches 199 203 +4
==========================================
+ Hits 1148 1151 +3
- Misses 439 447 +8
- Partials 32 34 +2
Continue to review full report at Codecov.
|
After further inspection, this should keep the environment unmodified, only removing all variables prefixed with MODMAIL_ in order to keep the environment more realistic of what would happen on a real environment, and only controlling the program specific environment variables. |
However, environment variables are currently not prefixed with |
This can be reviewed and merged, but will only have an effect on the testing environment once GH-75 is merged |
Merging main to get the updated workflows here. Will rebase before merge. |
@@ -6,6 +6,11 @@ | |||
import pytest | |||
|
|||
|
|||
_ORIG_ENVIRON = None | |||
|
|||
_modmail_env_prefix = "MODMAIL_" |
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 use modmail.config.ENV_PREFIX
once config PR is merged, worth adding a TODO
Co-authored-by: Shivansh-007 <shivansh-007@outlook.com>
continuation of #120
That solution using a fixture did not patch the environment soon enough. This will patch the environment and save a cache of the original environment, so it can replaced upon the end of a test run.