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
8876145f
Kaydet (Commit)
8876145f
authored
Ara 27, 2012
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #16793. Replace deprecated unittest asserts with modern counterparts.
üst
270767b2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
test_bitfields.py
Lib/ctypes/test/test_bitfields.py
+4
-4
test_calendar.py
Lib/test/test_calendar.py
+1
-1
test_int.py
Lib/test/test_int.py
+5
-5
test_mutex.py
Lib/test/test_mutex.py
+1
-1
test_tarfile.py
Lib/test/test_tarfile.py
+1
-1
No files found.
Lib/ctypes/test/test_bitfields.py
Dosyayı görüntüle @
8876145f
...
@@ -246,9 +246,9 @@ class BitFieldTest(unittest.TestCase):
...
@@ -246,9 +246,9 @@ class BitFieldTest(unittest.TestCase):
_fields_
=
[(
"a"
,
c_uint32
,
32
)]
_fields_
=
[(
"a"
,
c_uint32
,
32
)]
x
=
X
()
x
=
X
()
x
.
a
=
10
x
.
a
=
10
self
.
assertEqual
s
(
x
.
a
,
10
)
self
.
assertEqual
(
x
.
a
,
10
)
x
.
a
=
0xFDCBA987
x
.
a
=
0xFDCBA987
self
.
assertEqual
s
(
x
.
a
,
0xFDCBA987
)
self
.
assertEqual
(
x
.
a
,
0xFDCBA987
)
@unittest.skipUnless
(
hasattr
(
ctypes
,
"c_uint64"
),
"c_int64 is required"
)
@unittest.skipUnless
(
hasattr
(
ctypes
,
"c_uint64"
),
"c_int64 is required"
)
def
test_uint64
(
self
):
def
test_uint64
(
self
):
...
@@ -256,9 +256,9 @@ class BitFieldTest(unittest.TestCase):
...
@@ -256,9 +256,9 @@ class BitFieldTest(unittest.TestCase):
_fields_
=
[(
"a"
,
c_uint64
,
64
)]
_fields_
=
[(
"a"
,
c_uint64
,
64
)]
x
=
X
()
x
=
X
()
x
.
a
=
10
x
.
a
=
10
self
.
assertEqual
s
(
x
.
a
,
10
)
self
.
assertEqual
(
x
.
a
,
10
)
x
.
a
=
0xFEDCBA9876543211
x
.
a
=
0xFEDCBA9876543211
self
.
assertEqual
s
(
x
.
a
,
0xFEDCBA9876543211
)
self
.
assertEqual
(
x
.
a
,
0xFEDCBA9876543211
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
Lib/test/test_calendar.py
Dosyayı görüntüle @
8876145f
...
@@ -261,7 +261,7 @@ class CalendarTestCase(unittest.TestCase):
...
@@ -261,7 +261,7 @@ class CalendarTestCase(unittest.TestCase):
return
return
calendar
.
LocaleHTMLCalendar
(
locale
=
''
)
.
formatmonthname
(
2010
,
10
)
calendar
.
LocaleHTMLCalendar
(
locale
=
''
)
.
formatmonthname
(
2010
,
10
)
new_october
=
calendar
.
TextCalendar
()
.
formatmonthname
(
2010
,
10
,
10
)
new_october
=
calendar
.
TextCalendar
()
.
formatmonthname
(
2010
,
10
,
10
)
self
.
assertEqual
s
(
old_october
,
new_october
)
self
.
assertEqual
(
old_october
,
new_october
)
def
test_itermonthdates
(
self
):
def
test_itermonthdates
(
self
):
# ensure itermonthdates doesn't overflow after datetime.MAXYEAR
# ensure itermonthdates doesn't overflow after datetime.MAXYEAR
...
...
Lib/test/test_int.py
Dosyayı görüntüle @
8876145f
...
@@ -347,8 +347,8 @@ class IntTestCases(IntLongCommonTests, unittest.TestCase):
...
@@ -347,8 +347,8 @@ class IntTestCases(IntLongCommonTests, unittest.TestCase):
for
x
in
values
:
for
x
in
values
:
msg
=
'x has value
%
s and type
%
s'
%
(
x
,
type
(
x
)
.
__name__
)
msg
=
'x has value
%
s and type
%
s'
%
(
x
,
type
(
x
)
.
__name__
)
try
:
try
:
self
.
assertEqual
s
(
int
(
x
),
100
,
msg
=
msg
)
self
.
assertEqual
(
int
(
x
),
100
,
msg
=
msg
)
self
.
assertEqual
s
(
int
(
x
,
2
),
4
,
msg
=
msg
)
self
.
assertEqual
(
int
(
x
,
2
),
4
,
msg
=
msg
)
except
TypeError
,
err
:
except
TypeError
,
err
:
raise
AssertionError
(
'For
%
s got TypeError:
%
s'
%
raise
AssertionError
(
'For
%
s got TypeError:
%
s'
%
(
type
(
x
)
.
__name__
,
err
))
(
type
(
x
)
.
__name__
,
err
))
...
@@ -373,10 +373,10 @@ class IntTestCases(IntLongCommonTests, unittest.TestCase):
...
@@ -373,10 +373,10 @@ class IntTestCases(IntLongCommonTests, unittest.TestCase):
# expects x to be a string if base is given.
# expects x to be a string if base is given.
@test_support.cpython_only
@test_support.cpython_only
def
test_int_base_without_x_returns_0
(
self
):
def
test_int_base_without_x_returns_0
(
self
):
self
.
assertEqual
s
(
int
(
base
=
6
),
0
)
self
.
assertEqual
(
int
(
base
=
6
),
0
)
# Even invalid bases don't raise an exception.
# Even invalid bases don't raise an exception.
self
.
assertEqual
s
(
int
(
base
=
1
),
0
)
self
.
assertEqual
(
int
(
base
=
1
),
0
)
self
.
assertEqual
s
(
int
(
base
=
1000
),
0
)
self
.
assertEqual
(
int
(
base
=
1000
),
0
)
@test_support.cpython_only
@test_support.cpython_only
def
test_small_ints
(
self
):
def
test_small_ints
(
self
):
...
...
Lib/test/test_mutex.py
Dosyayı görüntüle @
8876145f
...
@@ -14,7 +14,7 @@ class MutexTest(unittest.TestCase):
...
@@ -14,7 +14,7 @@ class MutexTest(unittest.TestCase):
m
.
lock
(
called_by_mutex2
,
"eggs"
)
m
.
lock
(
called_by_mutex2
,
"eggs"
)
def
called_by_mutex2
(
some_data
):
def
called_by_mutex2
(
some_data
):
self
.
assertEqual
s
(
some_data
,
"eggs"
)
self
.
assertEqual
(
some_data
,
"eggs"
)
self
.
assertTrue
(
m
.
test
(),
"mutex not held"
)
self
.
assertTrue
(
m
.
test
(),
"mutex not held"
)
self
.
assertTrue
(
ready_for_2
,
self
.
assertTrue
(
ready_for_2
,
"called_by_mutex2 called too soon"
)
"called_by_mutex2 called too soon"
)
...
...
Lib/test/test_tarfile.py
Dosyayı görüntüle @
8876145f
...
@@ -858,7 +858,7 @@ class WriteTest(WriteTestBase):
...
@@ -858,7 +858,7 @@ class WriteTest(WriteTestBase):
tar
=
tarfile
.
open
(
tmpname
,
"r"
)
tar
=
tarfile
.
open
(
tmpname
,
"r"
)
for
t
in
tar
:
for
t
in
tar
:
self
.
assert
_
(
t
.
name
==
"."
or
t
.
name
.
startswith
(
"./"
))
self
.
assert
True
(
t
.
name
==
"."
or
t
.
name
.
startswith
(
"./"
))
tar
.
close
()
tar
.
close
()
finally
:
finally
:
os
.
chdir
(
cwd
)
os
.
chdir
(
cwd
)
...
...
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