-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fix override_settings issue #204
Conversation
I will close this until we have reached a conses in the issue, OK? |
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.
Hi @ewjoachim,
Thanks again for the detailed description. Would you mind adding the test you wrote here? You can add Django unit tests to pytest. They will still be picked up and executed.
Best!
Joe
Co-authored-by: Johannes Maron <[email protected]>
I don't need to, I'm pretty sure it happens identically with Pytest. The only reason I didn't use pytest on the repro repo was to keep things as simple as possible :) |
Ok, if you really want to have a test on this we're going to need black magic or a very specific setup, and in both cases it's going to be very brittle. In the tests, as they currently exist, the conf module is loaded as a side effect of importing other modules, which happens during test collection, before tests actually start running.
Also, any setup (except possibly the subprocess) is probably going to be very brittle: if the setup doesn't work, it means the test will always pass. I'm not sure there's a way to write a test so that if you inadvertently destroy the setup in a following PR, you'll still be testing something relevant. So if someone removes the fix in the future, it's likely that no test would fail. If you have another idea, I'm all ears. To be super duper extra clear: We can't write a test if we can't manage to achieve the following setup:
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #204 +/- ##
==========================================
+ Coverage 98.14% 99.27% +1.12%
==========================================
Files 7 7
Lines 270 276 +6
==========================================
+ Hits 265 274 +9
+ Misses 5 2 -3
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Thanks |
See #203 for context.
Also, this is enough to fix the issue in the reproduction repo.