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
48b5c98e
Kaydet (Commit)
48b5c98e
authored
Haz 13, 2016
tarafından
Berker Peksag
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replace more boilerplate code with modern unittest features in sqlite3 tests
üst
f5b1af6d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
13 deletions
+6
-13
dbapi.py
Lib/sqlite3/test/dbapi.py
+1
-2
hooks.py
Lib/sqlite3/test/hooks.py
+2
-2
regression.py
Lib/sqlite3/test/regression.py
+3
-9
No files found.
Lib/sqlite3/test/dbapi.py
Dosyayı görüntüle @
48b5c98e
...
@@ -335,8 +335,7 @@ class CursorTests(unittest.TestCase):
...
@@ -335,8 +335,7 @@ class CursorTests(unittest.TestCase):
def
CheckTotalChanges
(
self
):
def
CheckTotalChanges
(
self
):
self
.
cu
.
execute
(
"insert into test(name) values ('foo')"
)
self
.
cu
.
execute
(
"insert into test(name) values ('foo')"
)
self
.
cu
.
execute
(
"insert into test(name) values ('foo')"
)
self
.
cu
.
execute
(
"insert into test(name) values ('foo')"
)
if
self
.
cx
.
total_changes
<
2
:
self
.
assertLess
(
2
,
self
.
cx
.
total_changes
,
msg
=
'total changes reported wrong value'
)
self
.
fail
(
"total changes reported wrong value"
)
# Checks for executemany:
# Checks for executemany:
# Sequences are required by the DB-API, iterators
# Sequences are required by the DB-API, iterators
...
...
Lib/sqlite3/test/hooks.py
Dosyayı görüntüle @
48b5c98e
...
@@ -61,8 +61,8 @@ class CollationTests(unittest.TestCase):
...
@@ -61,8 +61,8 @@ class CollationTests(unittest.TestCase):
) order by x collate mycoll
) order by x collate mycoll
"""
"""
result
=
con
.
execute
(
sql
)
.
fetchall
()
result
=
con
.
execute
(
sql
)
.
fetchall
()
if
result
[
0
][
0
]
!=
"c"
or
result
[
1
][
0
]
!=
"b"
or
result
[
2
][
0
]
!=
"a"
:
self
.
assertEqual
(
result
,
[(
'c'
,),
(
'b'
,),
(
'a'
,)],
self
.
fail
(
"the expected order was not returned"
)
msg
=
'the expected order was not returned'
)
con
.
create_collation
(
"mycoll"
,
None
)
con
.
create_collation
(
"mycoll"
,
None
)
with
self
.
assertRaises
(
sqlite
.
OperationalError
)
as
cm
:
with
self
.
assertRaises
(
sqlite
.
OperationalError
)
as
cm
:
...
...
Lib/sqlite3/test/regression.py
Dosyayı görüntüle @
48b5c98e
...
@@ -134,17 +134,11 @@ class RegressionTests(unittest.TestCase):
...
@@ -134,17 +134,11 @@ class RegressionTests(unittest.TestCase):
def
CheckErrorMsgDecodeError
(
self
):
def
CheckErrorMsgDecodeError
(
self
):
# When porting the module to Python 3.0, the error message about
# When porting the module to Python 3.0, the error message about
# decoding errors disappeared. This verifies they're back again.
# decoding errors disappeared. This verifies they're back again.
failure
=
None
with
self
.
assertRaises
(
sqlite
.
OperationalError
)
as
cm
:
try
:
self
.
con
.
execute
(
"select 'xxx' || ? || 'yyy' colname"
,
self
.
con
.
execute
(
"select 'xxx' || ? || 'yyy' colname"
,
(
bytes
(
bytearray
([
250
])),))
.
fetchone
()
(
bytes
(
bytearray
([
250
])),))
.
fetchone
()
failure
=
"should have raised an OperationalError with detailed description"
msg
=
"Could not decode to UTF-8 column 'colname' with text 'xxx"
except
sqlite
.
OperationalError
as
e
:
self
.
assertIn
(
msg
,
str
(
cm
.
exception
))
msg
=
e
.
args
[
0
]
if
not
msg
.
startswith
(
"Could not decode to UTF-8 column 'colname' with text 'xxx"
):
failure
=
"OperationalError did not have expected description text"
if
failure
:
self
.
fail
(
failure
)
def
CheckRegisterAdapter
(
self
):
def
CheckRegisterAdapter
(
self
):
"""
"""
...
...
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