-
Notifications
You must be signed in to change notification settings - Fork 569
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
Refactor: tests to a separated layout, wiki package in src/ #631
Conversation
This already caught one error, having had test+development artifacts in the dist tarball/whl on Pypi. It's definitely going to give a much better guarantee that gaps between local development environments and distributed environments don't get confused in the tests: We test the dist, not the dev environment, as the blog post "Packaging a python library" says. |
fe4583b
to
70e2a89
Compare
70e2a89
to
b0edb87
Compare
Codecov Report
@@ Coverage Diff @@
## master #631 +/- ##
==========================================
+ Coverage 67.92% 67.93% +<.01%
==========================================
Files 87 87
Lines 4337 4335 -2
==========================================
- Hits 2946 2945 -1
+ Misses 1391 1390 -1
Continue to review full report at Codecov.
|
…e .` and the likes
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.
One question - Every looks 💯
@@ -64,7 +64,6 @@ def __call__(self, request): | |||
models.URLPath.root().article, | |||
self.request.user): | |||
self.results = self.__filter_can_read(self.request.user) | |||
#self.results = self.results.filter(current_revision__deleted=False) |
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.
@@ -0,0 +1,2 @@ | |||
from __future__ import absolute_import |
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.
Why is this file needed?
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.
As of now, it's needed because a lot of HTML files say {% load wiki_thumbnails %}
but I don't know if adding the register
from sorl actually makes any difference.. I should try deleting it, you're right!
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.
Just verified it, this is actually the reason :) I think it's to provide a decent wrapper for sorl.thumbnail on case it changes API or we add an alternative. Or maybe it's there for some historic reason.
@@ -7,8 +7,8 @@ | |||
from wiki.forms import Group | |||
from wiki.models import URLPath | |||
|
|||
from .base import wiki_override_settings | |||
from .testdata.models import CustomGroup | |||
from ..base import wiki_override_settings |
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.
👍
Gonna get this merged now and not let it sit in the way of future PRs! |
Refactor:
tests/
wiki
package now lives insrc/
From Pytest's Good Integration Practices: