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
801f9d38
Kaydet (Commit)
801f9d38
authored
Ara 27, 2008
tarafından
Hirokazu Yamamoto
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #4740: Use HIGHEST_PROTOCOL in pickle test. This enables test for protocol 3
(== HIGHEST_PROTOCOL in 3.x)
üst
81d90a22
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
test_array.py
Lib/test/test_array.py
+3
-3
test_deque.py
Lib/test/test_deque.py
+2
-2
test_set.py
Lib/test/test_set.py
+1
-1
No files found.
Lib/test/test_array.py
Dosyayı görüntüle @
801f9d38
...
@@ -7,7 +7,7 @@ import unittest
...
@@ -7,7 +7,7 @@ import unittest
from
test
import
support
from
test
import
support
from
weakref
import
proxy
from
weakref
import
proxy
import
array
,
io
,
math
import
array
,
io
,
math
from
pickle
import
loads
,
dumps
from
pickle
import
loads
,
dumps
,
HIGHEST_PROTOCOL
import
operator
import
operator
class
ArraySubclass
(
array
.
array
):
class
ArraySubclass
(
array
.
array
):
...
@@ -98,7 +98,7 @@ class BaseTest(unittest.TestCase):
...
@@ -98,7 +98,7 @@ class BaseTest(unittest.TestCase):
self
.
assertEqual
(
a
,
b
)
self
.
assertEqual
(
a
,
b
)
def
test_pickle
(
self
):
def
test_pickle
(
self
):
for
protocol
in
(
0
,
1
,
2
):
for
protocol
in
range
(
HIGHEST_PROTOCOL
+
1
):
a
=
array
.
array
(
self
.
typecode
,
self
.
example
)
a
=
array
.
array
(
self
.
typecode
,
self
.
example
)
b
=
loads
(
dumps
(
a
,
protocol
))
b
=
loads
(
dumps
(
a
,
protocol
))
self
.
assertNotEqual
(
id
(
a
),
id
(
b
))
self
.
assertNotEqual
(
id
(
a
),
id
(
b
))
...
@@ -113,7 +113,7 @@ class BaseTest(unittest.TestCase):
...
@@ -113,7 +113,7 @@ class BaseTest(unittest.TestCase):
self
.
assertEqual
(
type
(
a
),
type
(
b
))
self
.
assertEqual
(
type
(
a
),
type
(
b
))
def
test_pickle_for_empty_array
(
self
):
def
test_pickle_for_empty_array
(
self
):
for
protocol
in
(
0
,
1
,
2
):
for
protocol
in
range
(
HIGHEST_PROTOCOL
+
1
):
a
=
array
.
array
(
self
.
typecode
)
a
=
array
.
array
(
self
.
typecode
)
b
=
loads
(
dumps
(
a
,
protocol
))
b
=
loads
(
dumps
(
a
,
protocol
))
self
.
assertNotEqual
(
id
(
a
),
id
(
b
))
self
.
assertNotEqual
(
id
(
a
),
id
(
b
))
...
...
Lib/test/test_deque.py
Dosyayı görüntüle @
801f9d38
...
@@ -375,7 +375,7 @@ class TestBasic(unittest.TestCase):
...
@@ -375,7 +375,7 @@ class TestBasic(unittest.TestCase):
def
test_pickle
(
self
):
def
test_pickle
(
self
):
d
=
deque
(
range
(
200
))
d
=
deque
(
range
(
200
))
for
i
in
(
0
,
1
,
2
):
for
i
in
range
(
pickle
.
HIGHEST_PROTOCOL
+
1
):
s
=
pickle
.
dumps
(
d
,
i
)
s
=
pickle
.
dumps
(
d
,
i
)
e
=
pickle
.
loads
(
s
)
e
=
pickle
.
loads
(
s
)
self
.
assertNotEqual
(
id
(
d
),
id
(
e
))
self
.
assertNotEqual
(
id
(
d
),
id
(
e
))
...
@@ -384,7 +384,7 @@ class TestBasic(unittest.TestCase):
...
@@ -384,7 +384,7 @@ class TestBasic(unittest.TestCase):
## def test_pickle_recursive(self):
## def test_pickle_recursive(self):
## d = deque('abc')
## d = deque('abc')
## d.append(d)
## d.append(d)
## for i in
(0, 1, 2
):
## for i in
range(pickle.HIGHEST_PROTOCOL + 1
):
## e = pickle.loads(pickle.dumps(d, i))
## e = pickle.loads(pickle.dumps(d, i))
## self.assertNotEqual(id(d), id(e))
## self.assertNotEqual(id(d), id(e))
## self.assertEqual(id(e), id(e[-1]))
## self.assertEqual(id(e), id(e[-1]))
...
...
Lib/test/test_set.py
Dosyayı görüntüle @
801f9d38
...
@@ -219,7 +219,7 @@ class TestJointOps(unittest.TestCase):
...
@@ -219,7 +219,7 @@ class TestJointOps(unittest.TestCase):
self
.
failIf
(
set
(
'cbs'
)
.
issuperset
(
'a'
))
self
.
failIf
(
set
(
'cbs'
)
.
issuperset
(
'a'
))
def
test_pickling
(
self
):
def
test_pickling
(
self
):
for
i
in
(
0
,
1
,
2
):
for
i
in
range
(
pickle
.
HIGHEST_PROTOCOL
+
1
):
p
=
pickle
.
dumps
(
self
.
s
,
i
)
p
=
pickle
.
dumps
(
self
.
s
,
i
)
dup
=
pickle
.
loads
(
p
)
dup
=
pickle
.
loads
(
p
)
self
.
assertEqual
(
self
.
s
,
dup
,
"
%
s !=
%
s"
%
(
self
.
s
,
dup
))
self
.
assertEqual
(
self
.
s
,
dup
,
"
%
s !=
%
s"
%
(
self
.
s
,
dup
))
...
...
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