Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add tests for logging #30

wants to merge 1 commit into from

Conversation

zefciu
Copy link
Contributor

@zefciu zefciu commented Jan 28, 2019

Added a simple mixin to test logging in django application

@zefciu zefciu requested a review from dekoza January 28, 2019 12:43
@codecov-io
Copy link

codecov-io commented Jan 28, 2019

Codecov Report

Merging #30 into master will increase coverage by 0.88%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
djet/__init__.py 100% <ø> (ø) ⬆️
djet/files.py 90.78% <100%> (ø) ⬆️
djet/assertions.py 94.82% <100%> (+3.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0dae794...f3d9dff. Read the comment docs.


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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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?

@haxoza
Copy link
Member

haxoza commented Mar 21, 2019 via email

Added a simple mixin to test logging in django application
Copy link

@jellonek jellonek left a 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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants