Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
a3a5ef4d
Kaydet (Commit)
a3a5ef4d
authored
Agu 09, 2016
tarafından
Chris Jerdonek
Kaydeden (comit)
Tim Graham
Agu 09, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #27035 -- Eased changing settings.DEBUG for DiscoverRunner.
üst
ac1975b1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
4 deletions
+20
-4
runner.py
django/test/runner.py
+3
-2
1.11.txt
docs/releases/1.11.txt
+4
-0
advanced.txt
docs/topics/testing/advanced.txt
+9
-2
test_discover_runner.py
tests/test_runner/test_discover_runner.py
+4
-0
No files found.
django/test/runner.py
Dosyayı görüntüle @
a3a5ef4d
...
...
@@ -360,7 +360,7 @@ class DiscoverRunner(object):
def
__init__
(
self
,
pattern
=
None
,
top_level
=
None
,
verbosity
=
1
,
interactive
=
True
,
failfast
=
False
,
keepdb
=
False
,
reverse
=
False
,
debug_sql
=
False
,
parallel
=
0
,
reverse
=
False
,
debug_
mode
=
False
,
debug_
sql
=
False
,
parallel
=
0
,
tags
=
None
,
exclude_tags
=
None
,
**
kwargs
):
self
.
pattern
=
pattern
...
...
@@ -370,6 +370,7 @@ class DiscoverRunner(object):
self
.
failfast
=
failfast
self
.
keepdb
=
keepdb
self
.
reverse
=
reverse
self
.
debug_mode
=
debug_mode
self
.
debug_sql
=
debug_sql
self
.
parallel
=
parallel
self
.
tags
=
set
(
tags
or
[])
...
...
@@ -413,7 +414,7 @@ class DiscoverRunner(object):
def
setup_test_environment
(
self
,
**
kwargs
):
setup_test_environment
()
settings
.
DEBUG
=
Fals
e
settings
.
DEBUG
=
self
.
debug_mod
e
unittest
.
installHandler
()
def
build_suite
(
self
,
test_labels
=
None
,
extra_tests
=
None
,
**
kwargs
):
...
...
docs/releases/1.11.txt
Dosyayı görüntüle @
a3a5ef4d
...
...
@@ -259,6 +259,10 @@ Tests
* Added :meth:`.DiscoverRunner.get_test_runner_kwargs` to allow customizing the
keyword arguments passed to the test runner.
* Added the ``debug_mode`` keyword argument to
:class:`~django.test.runner.DiscoverRunner` to make it easier to customize
the :setting:`DEBUG` setting when running tests.
URLs
~~~~
...
...
docs/topics/testing/advanced.txt
Dosyayı görüntüle @
a3a5ef4d
...
...
@@ -427,7 +427,7 @@ behavior. This class defines the ``run_tests()`` entry point, plus a
selection of other methods that are used to by ``run_tests()`` to set up,
execute and tear down the test suite.
.. class:: DiscoverRunner(pattern='test*.py', top_level=None, verbosity=1, interactive=True, failfast=False, keepdb=False, reverse=False, debug_sql=False, **kwargs)
.. class:: DiscoverRunner(pattern='test*.py', top_level=None, verbosity=1, interactive=True, failfast=False, keepdb=False, reverse=False, debug_
mode=False, debug_
sql=False, **kwargs)
``DiscoverRunner`` will search for tests in any file matching ``pattern``.
...
...
@@ -458,6 +458,9 @@ execute and tear down the test suite.
and have side effects. :ref:`Grouping by test class <order-of-tests>` is
preserved when using this option.
``debug_mode`` specifies what the :setting:`DEBUG` setting should be
set to prior to running tests.
If ``debug_sql`` is ``True``, failing test cases will output SQL queries
logged to the :ref:`django.db.backends logger <django-db-logger>` as well
as the traceback. If ``verbosity`` is ``2``, then queries in all tests are
...
...
@@ -473,6 +476,10 @@ execute and tear down the test suite.
custom arguments by calling ``parser.add_argument()`` inside the method, so
that the :djadmin:`test` command will be able to use those arguments.
.. versionadded:: 1.11
The ``debug_mode`` keyword argument was added.
Attributes
~~~~~~~~~~
...
...
@@ -526,7 +533,7 @@ Methods
Sets up the test environment by calling
:func:`~django.test.utils.setup_test_environment` and setting
:setting:`DEBUG` to ``
False``
.
:setting:`DEBUG` to ``
self.debug_mode`` (defaults to ``False``)
.
.. method:: DiscoverRunner.build_suite(test_labels, extra_tests=None, **kwargs)
...
...
tests/test_runner/test_discover_runner.py
Dosyayı görüntüle @
a3a5ef4d
...
...
@@ -20,6 +20,10 @@ def change_cwd(directory):
class
DiscoverRunnerTest
(
TestCase
):
def
test_init_debug_mode
(
self
):
runner
=
DiscoverRunner
()
self
.
assertFalse
(
runner
.
debug_mode
)
def
test_dotted_test_module
(
self
):
count
=
DiscoverRunner
()
.
build_suite
(
[
"test_discovery_sample.tests_sample"
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment