Skip to content

Commit 36c9a0d

Browse files
committed
Follow the new convention for Django 11.0
a new option --debug-mode has been introduced, so let's name ours --django-debug-mode
1 parent a074460 commit 36c9a0d

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

docs/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Unreleased
66
Bugfixes
77
^^^^^^^^
88

9-
* Added a new option `--django-debug` to specify the default DEBUG setting (#228)
9+
* Added a new option `--django-debug-mode` to specify the default DEBUG setting (#228)
1010

1111
3.4.8 (2019-02-26)
1212
------------------

docs/configuring_django.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ But sometimes, especially for functional tests, you might want to avoid this, to
113113

114114
Command Line Option::
115115

116-
$ py.test --django-debug True|False|None
116+
$ py.test --django-debug-mode True|False|None
117117

118118
``None`` ensure there is no override of the test settings DEBUG value
119119
``True`` override DEBUG to True

pytest_django/plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ def pytest_addoption(parser):
108108
help="Enable Django migrations on test setup",
109109
)
110110
group._addoption(
111-
"--django-debug",
111+
"--django-debug-mode",
112112
action="store",
113-
dest="djangodebug",
113+
dest="djangodebugmode",
114114
default="None",
115115
help="Configure the DEBUG setting. Defaults to False"
116116
)
@@ -474,8 +474,8 @@ def django_test_environment(request):
474474
from django.conf import settings as dj_settings
475475
from django.test.utils import setup_test_environment, teardown_test_environment
476476

477-
if request.config.getvalue('djangodebug') != 'None':
478-
dj_settings.DEBUG = bool(strtobool(request.config.getvalue('djangodebug')))
477+
if request.config.getvalue('djangodebugmode') != 'None':
478+
dj_settings.DEBUG = bool(strtobool(request.config.getvalue('djangodebugmode')))
479479

480480
setup_test_environment()
481481
request.addfinalizer(teardown_test_environment)

tests/test_django_settings_module.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def test_debug_is_unchanged():
329329
assert settings.DEBUG is True
330330
""")
331331

332-
r = testdir.runpytest_subprocess('--django-debug=None')
332+
r = testdir.runpytest_subprocess('--django-debug-mode=None')
333333
assert r.ret == 0
334334

335335

@@ -354,7 +354,7 @@ def test_debug_is_false():
354354
assert settings.DEBUG is False
355355
""")
356356

357-
r = testdir.runpytest_subprocess('--django-debug=False')
357+
r = testdir.runpytest_subprocess('--django-debug-mode=False')
358358
assert r.ret == 0
359359

360360

@@ -379,7 +379,7 @@ def test_debug_is_true():
379379
assert settings.DEBUG is True
380380
""")
381381

382-
r = testdir.runpytest_subprocess('--django-debug=True')
382+
r = testdir.runpytest_subprocess('--django-debug-mode=True')
383383
assert r.ret == 0
384384

385385

0 commit comments

Comments
 (0)