Skip to content

Commit 2c9bc28

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 a63d216 commit 2c9bc28

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

docs/changelog.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Unreleased
77
Features
88
^^^^^^^^
99

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

1212
3.1.2
1313
-----

docs/configuring_django.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ But sometimes, especially for functional tests, you might want to avoid this, to
9292

9393
Command Line Option::
9494

95-
$ py.test --django-debug True|False|None
95+
$ py.test --django-debug-mode True|False|None
9696

9797
``None`` ensure there is no override of the test settings DEBUG value
9898
``True`` override DEBUG to True

pytest_django/plugin.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def pytest_addoption(parser):
6767
group._addoption('--migrations',
6868
action='store_false', dest='nomigrations', default=False,
6969
help='Enable Django migrations on test setup')
70-
group._addoption('--django-debug',
71-
action='store', dest='djangodebug', default='False',
70+
group._addoption('--django-debug-mode',
71+
action='store', dest='djangodebugmode', default='False',
7272
help='Configure the DEBUG setting. Defaults to False')
7373
parser.addini(CONFIGURATION_ENV,
7474
'django-configurations class to use by pytest-django.')
@@ -339,8 +339,8 @@ def django_test_environment(request):
339339
from django.conf import settings as dj_settings
340340
from django.test.utils import (setup_test_environment,
341341
teardown_test_environment)
342-
if request.config.getvalue('djangodebug') != 'None':
343-
dj_settings.DEBUG = bool(strtobool(request.config.getvalue('djangodebug')))
342+
if request.config.getvalue('djangodebugmode') != 'None':
343+
dj_settings.DEBUG = bool(strtobool(request.config.getvalue('djangodebugmode')))
344344
setup_test_environment()
345345
request.addfinalizer(teardown_test_environment)
346346

tests/test_django_settings_module.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def test_debug_is_unchanged():
296296
assert settings.DEBUG is True
297297
""")
298298

299-
r = testdir.runpytest_subprocess('--django-debug=None')
299+
r = testdir.runpytest_subprocess('--django-debug-mode=None')
300300
assert r.ret == 0
301301

302302

@@ -321,7 +321,7 @@ def test_debug_is_false():
321321
assert settings.DEBUG is False
322322
""")
323323

324-
r = testdir.runpytest_subprocess('--django-debug=False')
324+
r = testdir.runpytest_subprocess('--django-debug-mode=False')
325325
assert r.ret == 0
326326

327327

@@ -346,7 +346,7 @@ def test_debug_is_true():
346346
assert settings.DEBUG is True
347347
""")
348348

349-
r = testdir.runpytest_subprocess('--django-debug=True')
349+
r = testdir.runpytest_subprocess('--django-debug-mode=True')
350350
assert r.ret == 0
351351

352352

0 commit comments

Comments
 (0)