-
-
Notifications
You must be signed in to change notification settings - Fork 20
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 code smell issue in configuration #88
Comments
Mind if I look at this? I started looking at it at pycon and have some ideas |
Yes! Go ahead! |
Interesting, and related: @RalphHuber I started looking at #7 and this smell spread into my patch idea for that one really quickly, so I wound up yak shaving before I thought too hard about it. I have a quick idea that will get rid of the special case in I invite both you and @pydanny to please just close my PR and let me know it if it looks like it interferes with some more ambitious ideas you've been bouncing around for longer than the timebox I gave my yak shaving exercise. |
Addresses pydanny#88, at least partially. This adds a context manager that ensures django settings are reset on exit, and has the two unit tests that call `activate()` use it. It also adds two minimal settings modules that match the config those tests were seeing, and passes the names of those modules to `activate()` so that those are loaded using the same path as user-supplied settings modules. I thought about using pytest-django's settings fixture, but the way `activate()` and `Plus` interact made that smell more than the original hack.
At this point, for many cases `activate()` should just work. Tested very lightly so far, and currently depends on a fix to pydanny#88.
Closed in #120 |
Describe the bug
Code shouldn't know there might be tests. However, to get tests to work I hacked this into place.
Expected behavior
There should be no check for tests in regular code.
The text was updated successfully, but these errors were encountered: