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
c3b0757b
Kaydet (Commit)
c3b0757b
authored
Kas 13, 2009
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Silence getcheckinterval()-related warnings in the test suite
üst
589c2d39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
test_sys.py
Lib/test/test_sys.py
+8
-5
test_threading.py
Lib/test/test_threading.py
+3
-5
No files found.
Lib/test/test_sys.py
Dosyayı görüntüle @
c3b0757b
...
...
@@ -4,6 +4,7 @@ import sys, io, os
import
struct
import
subprocess
import
textwrap
import
warnings
# count the number of test runs, used to create unique
# strings to intern in test_intern()
...
...
@@ -148,11 +149,13 @@ class SysModuleTest(unittest.TestCase):
# testing sys.setprofile() is done in test_profile.py
def
test_setcheckinterval
(
self
):
self
.
assertRaises
(
TypeError
,
sys
.
setcheckinterval
)
orig
=
sys
.
getcheckinterval
()
for
n
in
0
,
100
,
120
,
orig
:
# orig last to restore starting state
sys
.
setcheckinterval
(
n
)
self
.
assertEquals
(
sys
.
getcheckinterval
(),
n
)
with
warnings
.
catch_warnings
():
warnings
.
simplefilter
(
"ignore"
)
self
.
assertRaises
(
TypeError
,
sys
.
setcheckinterval
)
orig
=
sys
.
getcheckinterval
()
for
n
in
0
,
100
,
120
,
orig
:
# orig last to restore starting state
sys
.
setcheckinterval
(
n
)
self
.
assertEquals
(
sys
.
getcheckinterval
(),
n
)
def
test_switchinterval
(
self
):
self
.
assertRaises
(
TypeError
,
sys
.
setswitchinterval
)
...
...
Lib/test/test_threading.py
Dosyayı görüntüle @
c3b0757b
...
...
@@ -342,12 +342,10 @@ class ThreadTests(BaseTestCase):
# Try hard to trigger #1703448: a thread is still returned in
# threading.enumerate() after it has been join()ed.
enum
=
threading
.
enumerate
old_interval
=
sys
.
get
check
interval
()
old_interval
=
sys
.
get
switch
interval
()
try
:
for
i
in
range
(
1
,
100
):
# Try a couple times at each thread-switching interval
# to get more interleavings.
sys
.
setcheckinterval
(
i
//
5
)
sys
.
setswitchinterval
(
i
*
0.0002
)
t
=
threading
.
Thread
(
target
=
lambda
:
None
)
t
.
start
()
t
.
join
()
...
...
@@ -355,7 +353,7 @@ class ThreadTests(BaseTestCase):
self
.
assertFalse
(
t
in
l
,
"#1703448 triggered after
%
d trials:
%
s"
%
(
i
,
l
))
finally
:
sys
.
set
check
interval
(
old_interval
)
sys
.
set
switch
interval
(
old_interval
)
def
test_no_refcycle_through_target
(
self
):
class
RunSelfFunction
(
object
):
...
...
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