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
b37ac8ea
Kaydet (Commit)
b37ac8ea
authored
Kas 14, 2012
tarafından
Philip Jenvey
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
don't gc_collect on CPython to guarantee a lack of ref cycles (thanks Antoine)
üst
f9e49eae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
test_exceptions.py
Lib/test/test_exceptions.py
+9
-5
No files found.
Lib/test/test_exceptions.py
Dosyayı görüntüle @
b37ac8ea
...
@@ -7,8 +7,8 @@ import pickle
...
@@ -7,8 +7,8 @@ import pickle
import
weakref
import
weakref
import
errno
import
errno
from
test.support
import
(
TESTFN
,
unlink
,
run_unittest
,
captured_output
,
from
test.support
import
(
TESTFN
,
captured_output
,
check_impl_detail
,
gc_collect
,
cpython_only
)
cpython_only
,
gc_collect
,
run_unittest
,
unlink
)
# XXX This is not really enough, each *operation* should be tested!
# XXX This is not really enough, each *operation* should be tested!
...
@@ -493,7 +493,9 @@ class ExceptionTests(unittest.TestCase):
...
@@ -493,7 +493,9 @@ class ExceptionTests(unittest.TestCase):
e
.
__context__
=
None
e
.
__context__
=
None
obj
=
None
obj
=
None
obj
=
wr
()
obj
=
wr
()
gc_collect
()
# guarantee no ref cycles on CPython (don't gc_collect)
if
check_impl_detail
(
cpython
=
False
):
gc_collect
()
self
.
assertTrue
(
obj
is
None
,
"
%
s"
%
obj
)
self
.
assertTrue
(
obj
is
None
,
"
%
s"
%
obj
)
# Some complicated construct
# Some complicated construct
...
@@ -510,7 +512,8 @@ class ExceptionTests(unittest.TestCase):
...
@@ -510,7 +512,8 @@ class ExceptionTests(unittest.TestCase):
except
MyException
:
except
MyException
:
pass
pass
obj
=
None
obj
=
None
gc_collect
()
if
check_impl_detail
(
cpython
=
False
):
gc_collect
()
obj
=
wr
()
obj
=
wr
()
self
.
assertTrue
(
obj
is
None
,
"
%
s"
%
obj
)
self
.
assertTrue
(
obj
is
None
,
"
%
s"
%
obj
)
...
@@ -525,7 +528,8 @@ class ExceptionTests(unittest.TestCase):
...
@@ -525,7 +528,8 @@ class ExceptionTests(unittest.TestCase):
with
Context
():
with
Context
():
inner_raising_func
()
inner_raising_func
()
obj
=
None
obj
=
None
gc_collect
()
if
check_impl_detail
(
cpython
=
False
):
gc_collect
()
obj
=
wr
()
obj
=
wr
()
self
.
assertTrue
(
obj
is
None
,
"
%
s"
%
obj
)
self
.
assertTrue
(
obj
is
None
,
"
%
s"
%
obj
)
...
...
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