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
40f55b2f
Kaydet (Commit)
40f55b2f
authored
May 09, 2006
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Disable a test that is unreliable.
üst
b255069d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
test_python_api.py
Lib/ctypes/test/test_python_api.py
+16
-11
No files found.
Lib/ctypes/test/test_python_api.py
Dosyayı görüntüle @
40f55b2f
from
ctypes
import
*
import
unittest
,
sys
from
ctypes.test
import
is_resource_enabled
################################################################
# This section should be moved into ctypes\__init__.py, when it's ready.
...
...
@@ -33,20 +34,24 @@ class PythonAPITestCase(unittest.TestCase):
del
pyob
self
.
failUnlessEqual
(
grc
(
s
),
refcnt
)
def
test_PyInt_Long
(
self
):
ref42
=
grc
(
42
)
pythonapi
.
PyInt_FromLong
.
restype
=
py_object
self
.
failUnlessEqual
(
pythonapi
.
PyInt_FromLong
(
42
),
42
)
if
is_resource_enabled
(
"refcount"
):
# This test is unreliable, because it is possible that code in
# unittest changes the refcount of the '42' integer. So, it
# is disabled by default.
def
test_PyInt_Long
(
self
):
ref42
=
grc
(
42
)
pythonapi
.
PyInt_FromLong
.
restype
=
py_object
self
.
failUnlessEqual
(
pythonapi
.
PyInt_FromLong
(
42
),
42
)
self
.
failUnlessEqual
(
grc
(
42
),
ref42
)
self
.
failUnlessEqual
(
grc
(
42
),
ref42
)
pythonapi
.
PyInt_AsLong
.
argtypes
=
(
py_object
,)
pythonapi
.
PyInt_AsLong
.
restype
=
c_long
pythonapi
.
PyInt_AsLong
.
argtypes
=
(
py_object
,)
pythonapi
.
PyInt_AsLong
.
restype
=
c_long
res
=
pythonapi
.
PyInt_AsLong
(
42
)
self
.
failUnlessEqual
(
grc
(
res
),
ref42
+
1
)
del
res
self
.
failUnlessEqual
(
grc
(
42
),
ref42
)
res
=
pythonapi
.
PyInt_AsLong
(
42
)
self
.
failUnlessEqual
(
grc
(
res
),
ref42
+
1
)
del
res
self
.
failUnlessEqual
(
grc
(
42
),
ref42
)
def
test_PyObj_FromPtr
(
self
):
s
=
"abc def ghi jkl"
...
...
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