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
2c9a03d4
Kaydet (Commit)
2c9a03d4
authored
Eki 23, 2014
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23707 -- Prevented discovery of duplicated tests
üst
92269b7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
runner.py
django/test/runner.py
+5
-3
test_discover_runner.py
tests/test_runner/test_discover_runner.py
+9
-0
No files found.
django/test/runner.py
Dosyayı görüntüle @
2c9a03d4
...
...
@@ -233,7 +233,7 @@ def reorder_suite(suite, classes):
def
partition_suite
(
suite
,
classes
,
bins
):
"""
Partitions a test suite by test type.
Partitions a test suite by test type.
Also prevents duplicated tests.
classes is a sequence of types
bins is a sequence of TestSuites, one more than classes
...
...
@@ -248,10 +248,12 @@ def partition_suite(suite, classes, bins):
else
:
for
i
in
range
(
len
(
classes
)):
if
isinstance
(
test
,
classes
[
i
]):
bins
[
i
]
.
addTest
(
test
)
if
test
not
in
bins
[
i
]:
bins
[
i
]
.
addTest
(
test
)
break
else
:
bins
[
-
1
]
.
addTest
(
test
)
if
test
not
in
bins
[
-
1
]:
bins
[
-
1
]
.
addTest
(
test
)
def
setup_databases
(
verbosity
,
interactive
,
keepdb
=
False
,
**
kwargs
):
...
...
tests/test_runner/test_discover_runner.py
Dosyayı görüntüle @
2c9a03d4
...
...
@@ -117,6 +117,15 @@ class DiscoverRunnerTest(TestCase):
# All others can follow in unspecified order, including doctests
self
.
assertIn
(
'DocTestCase'
,
[
t
.
__class__
.
__name__
for
t
in
suite
.
_tests
[
2
:]])
def
test_duplicates_ignored
(
self
):
"""
Tests shouldn't be discovered twice when discovering on overlapping paths.
"""
single
=
DiscoverRunner
()
.
build_suite
([
"django.contrib.gis"
])
.
countTestCases
()
dups
=
DiscoverRunner
()
.
build_suite
(
[
"django.contrib.gis"
,
"django.contrib.gis.tests.geo3d"
])
.
countTestCases
()
self
.
assertEqual
(
single
,
dups
)
def
test_overrideable_test_suite
(
self
):
self
.
assertEqual
(
DiscoverRunner
()
.
test_suite
,
TestSuite
)
...
...
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