Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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
cpython
Commits
8913a6c8
Kaydet (Commit)
8913a6c8
authored
Eyl 01, 2013
tarafından
Andrew Svetlov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11798: fix tests for regrtest -R :
üst
59360aad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
regrtest.py
Lib/test/regrtest.py
+5
-0
suite.py
Lib/unittest/suite.py
+6
-2
test_suite.py
Lib/unittest/test/test_suite.py
+8
-0
No files found.
Lib/test/regrtest.py
Dosyayı görüntüle @
8913a6c8
...
...
@@ -496,6 +496,8 @@ def main(tests=None, **kwargs):
if
ns
.
slaveargs
is
not
None
:
args
,
kwargs
=
json
.
loads
(
ns
.
slaveargs
)
if
kwargs
.
get
(
'huntrleaks'
):
unittest
.
BaseTestSuite
.
_cleanup
=
False
try
:
result
=
runtest
(
*
args
,
**
kwargs
)
except
KeyboardInterrupt
:
...
...
@@ -528,6 +530,9 @@ def main(tests=None, **kwargs):
#gc.set_debug(gc.DEBUG_SAVEALL)
found_garbage
=
[]
if
ns
.
huntrleaks
:
unittest
.
BaseTestSuite
.
_cleanup
=
False
if
ns
.
single
:
filename
=
os
.
path
.
join
(
TEMPDIR
,
'pynexttest'
)
try
:
...
...
Lib/unittest/suite.py
Dosyayı görüntüle @
8913a6c8
...
...
@@ -16,6 +16,8 @@ def _call_if_exists(parent, attr):
class
BaseTestSuite
(
object
):
"""A simple test suite that doesn't provide class or module shared fixtures.
"""
_cleanup
=
True
def
__init__
(
self
,
tests
=
()):
self
.
_tests
=
[]
self
.
addTests
(
tests
)
...
...
@@ -61,7 +63,8 @@ class BaseTestSuite(object):
if
result
.
shouldStop
:
break
test
(
result
)
self
.
_removeTestAtIndex
(
index
)
if
self
.
_cleanup
:
self
.
_removeTestAtIndex
(
index
)
return
result
def
_removeTestAtIndex
(
self
,
index
):
...
...
@@ -115,7 +118,8 @@ class TestSuite(BaseTestSuite):
else
:
test
.
debug
()
self
.
_removeTestAtIndex
(
index
)
if
self
.
_cleanup
:
self
.
_removeTestAtIndex
(
index
)
if
topLevel
:
self
.
_tearDownPreviousClass
(
None
,
result
)
...
...
Lib/unittest/test/test_suite.py
Dosyayı görüntüle @
8913a6c8
...
...
@@ -303,6 +303,9 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
suite
.
run
(
unittest
.
TestResult
())
def
test_remove_test_at_index
(
self
):
if
not
unittest
.
BaseTestSuite
.
_cleanup
:
raise
unittest
.
SkipTest
(
"Suite cleanup is disabled"
)
suite
=
unittest
.
TestSuite
()
suite
.
_tests
=
[
1
,
2
,
3
]
...
...
@@ -311,6 +314,9 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
self
.
assertEqual
([
1
,
None
,
3
],
suite
.
_tests
)
def
test_remove_test_at_index_not_indexable
(
self
):
if
not
unittest
.
BaseTestSuite
.
_cleanup
:
raise
unittest
.
SkipTest
(
"Suite cleanup is disabled"
)
suite
=
unittest
.
TestSuite
()
suite
.
_tests
=
None
...
...
@@ -318,6 +324,8 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
suite
.
_removeTestAtIndex
(
2
)
def
assert_garbage_collect_test_after_run
(
self
,
TestSuiteClass
):
if
not
unittest
.
BaseTestSuite
.
_cleanup
:
raise
unittest
.
SkipTest
(
"Suite cleanup is disabled"
)
class
Foo
(
unittest
.
TestCase
):
def
test_nothing
(
self
):
...
...
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