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

Implement --debug-mode option to set DEBUG to True prior to run tests #502

Closed
wants to merge 7 commits into from

Conversation

adrysn
Copy link

@adrysn adrysn commented Aug 9, 2017

Follows #463 since it has been quite a while after the last discussion in the PR.

I just slightly changed @dulaccc's PR. Changes are:

  1. option name --django-debug is changed to --debug-mode to follow the naming in Django 1.11 (https://docs.djangoproject.com/en/dev/ref/django-admin/#cmdoption-test-debug-mode).
  2. --debug-mode is boolean-basis, not string-basis. For example,
    • pytest runs tests in non-debug mode (DEBUG=False)
    • pytest --debug-mode runs tests in debug mode (DEBUG=True)
  3. as a result of 2., tests other than testing override DEBUG to True is removed.

@codecov-io
Copy link

codecov-io commented Oct 10, 2017

Codecov Report

Merging #502 into master will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #502     +/-   ##
=========================================
+ Coverage   85.74%   85.85%   +0.1%     
=========================================
  Files          32       32             
  Lines        1614     1626     +12     
  Branches      140      141      +1     
=========================================
+ Hits         1384     1396     +12     
  Misses        177      177             
  Partials       53       53
Flag Coverage Δ
#django110 81.73% <85.71%> (+0.01%) ⬆️
#django111 83.39% <78.57%> (-0.07%) ⬇️
#django17 79.64% <85.71%> (+0.02%) ⬆️
#django18 80.81% <85.71%> (+0.01%) ⬆️
#django19 79.88% <85.71%> (+0.02%) ⬆️
#mysql_innodb 78.96% <78.57%> (-0.03%) ⬇️
#mysql_myisam 78.9% <78.57%> (-0.03%) ⬇️
#postgres 81.36% <100%> (+0.13%) ⬆️
#py27 83.14% <100%> (+0.12%) ⬆️
#py34 81.05% <100%> (+0.14%) ⬆️
#py35 79.08% <78.57%> (-0.04%) ⬇️
#py36 81.05% <100%> (+0.14%) ⬆️
#pypy 81.73% <100%> (+0.13%) ⬆️
#pypy3 80.81% <85.71%> (+0.01%) ⬆️
#pytest3 85.85% <100%> (+0.1%) ⬆️
#sqlite 81.73% <100%> (+0.13%) ⬆️
#sqlite_file 80.44% <100%> (+0.14%) ⬆️
Impacted Files Coverage Δ
pytest_django/plugin.py 67.96% <100%> (+0.58%) ⬆️
tests/test_django_settings_module.py 100% <100%> (ø) ⬆️

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 781daae...26d58b8. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Oct 10, 2017

Codecov Report

Merging #502 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #502      +/-   ##
==========================================
+ Coverage   91.92%   91.98%   +0.05%     
==========================================
  Files          33       33              
  Lines        1660     1672      +12     
  Branches      143      144       +1     
==========================================
+ Hits         1526     1538      +12     
  Misses         95       95              
  Partials       39       39
Flag Coverage Δ
#dj110 83.91% <85.71%> (-0.01%) ⬇️
#dj111 86% <78.57%> (-0.08%) ⬇️
#dj18 84.74% <85.71%> (-0.02%) ⬇️
#dj19 83.79% <85.71%> (-0.01%) ⬇️
#dj20 84.15% <78.57%> (-0.07%) ⬇️
#djmaster ?
#mysql_innodb 84.15% <78.57%> (-0.07%) ⬇️
#mysql_myisam 84.09% <78.57%> (-0.07%) ⬇️
#postgres 87.67% <100%> (+0.08%) ⬆️
#py27 89.29% <100%> (+0.07%) ⬆️
#py34 83.79% <85.71%> (-0.01%) ⬇️
#py35 83.91% <85.71%> (-0.01%) ⬇️
#py36 84.62% <78.57%> (-0.07%) ⬇️
#sqlite 86.06% <100%> (+0.1%) ⬆️
#sqlite_file 83.79% <85.71%> (-0.01%) ⬇️
Impacted Files Coverage Δ
tests/test_django_settings_module.py 100% <100%> (ø) ⬆️
pytest_django/plugin.py 86% <100%> (+0.24%) ⬆️

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 927d6c1...bc57e52. Read the comment docs.

@blueyed
Copy link
Contributor

blueyed commented Oct 27, 2017

I would prefer a --django prefix with the option, since it comes from the pytest-django plugin.

Copy link
Contributor

@blueyed blueyed left a comment

Choose a reason for hiding this comment

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

See above.
Also needs to be rebased.

action='store_true', dest='debug_mode', default=False,
help='Set DEBUG to true prior to run tests')
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick (no need to change it already): s/true/True ?!

Copy link
Author

Choose a reason for hiding this comment

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

I'll change it. Thanks.

@adrysn
Copy link
Author

adrysn commented Jan 28, 2018

It seems that original pull-request is active again (#463), so it would be appropriate that I close this pull-request.

@adrysn adrysn closed this Jan 28, 2018
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.

None yet

3 participants