-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add tests for logging #30
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #30 +/- ##
==========================================
+ Coverage 94.41% 95.29% +0.88%
==========================================
Files 5 5
Lines 340 425 +85
==========================================
+ Hits 321 405 +84
- Misses 19 20 +1
Continue to review full report at Codecov.
|
|
||
Remember that if you want to use assertions e.g. from ``MessagesAssertionsMixin`` | ||
you must also add ``middleware_classes`` required by messages to your test case. | ||
We do not add them for you in mixin, because we believe those mixin classes shouldn't | ||
implicitly mess with middleware, because it would make it harder to understand | ||
what and why exactly is happening in your tests. | ||
|
||
You should also note that when using ``LoggingAssertionsMixing`` you need to | ||
call ``super()`` in your ``setUp()`` and ``tearDown()`` methods, bucause this | ||
mixin depends on its own setup. |
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.
Couldn't be that like here?
https://github.com/sunscrapers/djet/blob/master/djet/files.py#L59
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.
Could you be more precise? Do you suggest using _pre_setup
and _post_teardown
to for setting up the logging? Or to use InMemoryStorageMixin
to store the logging?
Yup, I mean `_pre_setup` and `_post_teardown` methods. Thanks to that it
will be easier for user (other programmer) to use the mixin.
…On Thu, Mar 21, 2019 at 8:00 AM Szymon Pyżalski ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In docs/source/getting_started.rst
<#30 (comment)>:
>
Remember that if you want to use assertions e.g. from ``MessagesAssertionsMixin``
you must also add ``middleware_classes`` required by messages to your test case.
We do not add them for you in mixin, because we believe those mixin classes shouldn't
implicitly mess with middleware, because it would make it harder to understand
what and why exactly is happening in your tests.
+You should also note that when using ``LoggingAssertionsMixing`` you need to
+call ``super()`` in your ``setUp()`` and ``tearDown()`` methods, bucause this
+mixin depends on its own setup.
Could you be more precise? Do you suggest using _pre_setup and
_post_teardown to for setting up the logging? Or to use
InMemoryStorageMixin to store the logging?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#30 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA7IUvL3niMtuV0fyo1bH6Pw3pEAHNW2ks5vYy30gaJpZM4aV1dh>
.
|
bf48fb7
to
67c7782
Compare
Added a simple mixin to test logging in django application
67c7782
to
f3d9dff
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.
Small nit, but still LGTM ;)
@@ -39,3 +39,6 @@ ENV/ | |||
# logs | |||
*.log | |||
.pytest_cache/ | |||
|
|||
# vim | |||
*.swp |
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.
It's not project specific and imo that's why it should be kept in developer own global git ignore file.
Added a simple mixin to test logging in django application