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
53ea1620
Kaydet (Commit)
53ea1620
authored
Mar 28, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make some tests more frienly to MemoryError.
Free memory, unlock hanging threads.
üst
582265f4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
16 deletions
+41
-16
test_find.py
Lib/ctypes/test/test_find.py
+11
-2
test_pointers.py
Lib/ctypes/test/test_pointers.py
+2
-2
lock_tests.py
Lib/test/lock_tests.py
+6
-2
test_gc.py
Lib/test/test_gc.py
+6
-4
test_io.py
Lib/test/test_io.py
+10
-4
test_itertools.py
Lib/test/test_itertools.py
+6
-2
No files found.
Lib/ctypes/test/test_find.py
Dosyayı görüntüle @
53ea1620
...
...
@@ -32,15 +32,24 @@ class Test_OpenGL_libs(unittest.TestCase):
def
setUp
(
self
):
self
.
gl
=
self
.
glu
=
self
.
gle
=
None
if
lib_gl
:
self
.
gl
=
CDLL
(
lib_gl
,
mode
=
RTLD_GLOBAL
)
try
:
self
.
gl
=
CDLL
(
lib_gl
,
mode
=
RTLD_GLOBAL
)
except
OSError
:
pass
if
lib_glu
:
self
.
glu
=
CDLL
(
lib_glu
,
RTLD_GLOBAL
)
try
:
self
.
glu
=
CDLL
(
lib_glu
,
RTLD_GLOBAL
)
except
OSError
:
pass
if
lib_gle
:
try
:
self
.
gle
=
CDLL
(
lib_gle
)
except
OSError
:
pass
def
tearDown
(
self
):
self
.
gl
=
self
.
glu
=
self
.
gle
=
None
@unittest.skipUnless
(
lib_gl
,
'lib_gl not available'
)
def
test_gl
(
self
):
if
self
.
gl
:
...
...
Lib/ctypes/test/test_pointers.py
Dosyayı görüntüle @
53ea1620
...
...
@@ -7,8 +7,6 @@ ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint,
c_long
,
c_ulong
,
c_longlong
,
c_ulonglong
,
c_double
,
c_float
]
python_types
=
[
int
,
int
,
int
,
int
,
int
,
long
,
int
,
long
,
long
,
long
,
float
,
float
]
LargeNamedType
=
type
(
'T'
*
2
**
25
,
(
Structure
,),
{})
large_string
=
'T'
*
2
**
25
class
PointersTestCase
(
unittest
.
TestCase
):
...
...
@@ -191,9 +189,11 @@ class PointersTestCase(unittest.TestCase):
self
.
assertEqual
(
bool
(
mth
),
True
)
def
test_pointer_type_name
(
self
):
LargeNamedType
=
type
(
'T'
*
2
**
25
,
(
Structure
,),
{})
self
.
assertTrue
(
POINTER
(
LargeNamedType
))
def
test_pointer_type_str_name
(
self
):
large_string
=
'T'
*
2
**
25
self
.
assertTrue
(
POINTER
(
large_string
))
if
__name__
==
'__main__'
:
...
...
Lib/test/lock_tests.py
Dosyayı görüntüle @
53ea1620
...
...
@@ -39,8 +39,12 @@ class Bunch(object):
self
.
finished
.
append
(
tid
)
while
not
self
.
_can_exit
:
_wait
()
for
i
in
range
(
n
):
start_new_thread
(
task
,
())
try
:
for
i
in
range
(
n
):
start_new_thread
(
task
,
())
except
:
self
.
_can_exit
=
True
raise
def
wait_for_started
(
self
):
while
len
(
self
.
started
)
<
self
.
n
:
...
...
Lib/test/test_gc.py
Dosyayı görüntüle @
53ea1620
...
...
@@ -357,10 +357,12 @@ class GCTests(unittest.TestCase):
for
i
in
range
(
N_THREADS
):
t
=
threading
.
Thread
(
target
=
run_thread
)
threads
.
append
(
t
)
for
t
in
threads
:
t
.
start
()
time
.
sleep
(
1.0
)
exit
=
True
try
:
for
t
in
threads
:
t
.
start
()
finally
:
time
.
sleep
(
1.0
)
exit
=
True
for
t
in
threads
:
t
.
join
()
finally
:
...
...
Lib/test/test_io.py
Dosyayı görüntüle @
53ea1620
...
...
@@ -3149,11 +3149,15 @@ class SignalsTest(unittest.TestCase):
# received (forcing a first EINTR in write()).
read_results
=
[]
write_finished
=
False
error
=
[
None
]
def
_read
():
while
not
write_finished
:
while
r
in
select
.
select
([
r
],
[],
[],
1.0
)[
0
]:
s
=
os
.
read
(
r
,
1024
)
read_results
.
append
(
s
)
try
:
while
not
write_finished
:
while
r
in
select
.
select
([
r
],
[],
[],
1.0
)[
0
]:
s
=
os
.
read
(
r
,
1024
)
read_results
.
append
(
s
)
except
BaseException
as
exc
:
error
[
0
]
=
exc
t
=
threading
.
Thread
(
target
=
_read
)
t
.
daemon
=
True
def
alarm1
(
sig
,
frame
):
...
...
@@ -3174,6 +3178,8 @@ class SignalsTest(unittest.TestCase):
wio
.
flush
()
write_finished
=
True
t
.
join
()
self
.
assertIsNone
(
error
[
0
])
self
.
assertEqual
(
N
,
sum
(
len
(
x
)
for
x
in
read_results
))
finally
:
write_finished
=
True
...
...
Lib/test/test_itertools.py
Dosyayı görüntüle @
53ea1620
...
...
@@ -949,8 +949,12 @@ class TestBasicOps(unittest.TestCase):
# Issue 13454: Crash when deleting backward iterator from tee()
def
test_tee_del_backward
(
self
):
forward
,
backward
=
tee
(
repeat
(
None
,
20000000
))
any
(
forward
)
# exhaust the iterator
del
backward
try
:
any
(
forward
)
# exhaust the iterator
del
backward
except
:
del
forward
,
backward
raise
def
test_StopIteration
(
self
):
self
.
assertRaises
(
StopIteration
,
izip
()
.
next
)
...
...
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