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
f79493bf
Kaydet (Commit)
f79493bf
authored
Mar 01, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#17082: test_dbm* now work with unittest test discovery. Patch by Zachary Ware.
üst
520378f8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
28 deletions
+17
-28
test_dbm.py
Lib/test/test_dbm.py
+10
-10
test_dbm_dumb.py
Lib/test/test_dbm_dumb.py
+1
-9
test_dbm_gnu.py
Lib/test/test_dbm_gnu.py
+2
-5
test_dbm_ndbm.py
Lib/test/test_dbm_ndbm.py
+1
-4
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_dbm.py
Dosyayı görüntüle @
f79493bf
...
@@ -34,7 +34,7 @@ def delete_files():
...
@@ -34,7 +34,7 @@ def delete_files():
test
.
support
.
unlink
(
f
)
test
.
support
.
unlink
(
f
)
class
AnyDBMTestCase
(
unittest
.
TestCase
)
:
class
AnyDBMTestCase
:
_dict
=
{
'0'
:
b
''
,
_dict
=
{
'0'
:
b
''
,
'a'
:
b
'Python:'
,
'a'
:
b
'Python:'
,
'b'
:
b
'Programming'
,
'b'
:
b
'Programming'
,
...
@@ -119,10 +119,6 @@ class AnyDBMTestCase(unittest.TestCase):
...
@@ -119,10 +119,6 @@ class AnyDBMTestCase(unittest.TestCase):
class
WhichDBTestCase
(
unittest
.
TestCase
):
class
WhichDBTestCase
(
unittest
.
TestCase
):
# Actual test methods are added to namespace after class definition.
def
__init__
(
self
,
*
args
):
unittest
.
TestCase
.
__init__
(
self
,
*
args
)
def
test_whichdb
(
self
):
def
test_whichdb
(
self
):
for
module
in
dbm_iterator
():
for
module
in
dbm_iterator
():
# Check whether whichdb correctly guesses module name
# Check whether whichdb correctly guesses module name
...
@@ -169,12 +165,16 @@ class WhichDBTestCase(unittest.TestCase):
...
@@ -169,12 +165,16 @@ class WhichDBTestCase(unittest.TestCase):
self
.
d
.
close
()
self
.
d
.
close
()
def
test_main
(
):
def
load_tests
(
loader
,
tests
,
pattern
):
classes
=
[
WhichDBTestCase
]
classes
=
[]
for
mod
in
dbm_iterator
():
for
mod
in
dbm_iterator
():
classes
.
append
(
type
(
"TestCase-"
+
mod
.
__name__
,
(
AnyDBMTestCase
,),
classes
.
append
(
type
(
"TestCase-"
+
mod
.
__name__
,
(
AnyDBMTestCase
,
unittest
.
TestCase
),
{
'module'
:
mod
}))
{
'module'
:
mod
}))
test
.
support
.
run_unittest
(
*
classes
)
suites
=
[
unittest
.
makeSuite
(
c
)
for
c
in
classes
]
tests
.
addTests
(
suites
)
return
tests
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
test_
main
()
unittest
.
main
()
Lib/test/test_dbm_dumb.py
Dosyayı görüntüle @
f79493bf
...
@@ -29,9 +29,6 @@ class DumbDBMTestCase(unittest.TestCase):
...
@@ -29,9 +29,6 @@ class DumbDBMTestCase(unittest.TestCase):
'
\u00fc
'
.
encode
(
'utf-8'
)
:
b
'!'
,
'
\u00fc
'
.
encode
(
'utf-8'
)
:
b
'!'
,
}
}
def
__init__
(
self
,
*
args
):
unittest
.
TestCase
.
__init__
(
self
,
*
args
)
def
test_dumbdbm_creation
(
self
):
def
test_dumbdbm_creation
(
self
):
f
=
dumbdbm
.
open
(
_fname
,
'c'
)
f
=
dumbdbm
.
open
(
_fname
,
'c'
)
self
.
assertEqual
(
list
(
f
.
keys
()),
[])
self
.
assertEqual
(
list
(
f
.
keys
()),
[])
...
@@ -195,11 +192,6 @@ class DumbDBMTestCase(unittest.TestCase):
...
@@ -195,11 +192,6 @@ class DumbDBMTestCase(unittest.TestCase):
def
setUp
(
self
):
def
setUp
(
self
):
_delete_files
()
_delete_files
()
def
test_main
():
try
:
support
.
run_unittest
(
DumbDBMTestCase
)
finally
:
_delete_files
()
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
test_
main
()
unittest
.
main
()
Lib/test/test_dbm_gnu.py
Dosyayı görüntüle @
f79493bf
...
@@ -2,7 +2,7 @@ from test import support
...
@@ -2,7 +2,7 @@ from test import support
gdbm
=
support
.
import_module
(
"dbm.gnu"
)
#skip if not supported
gdbm
=
support
.
import_module
(
"dbm.gnu"
)
#skip if not supported
import
unittest
import
unittest
import
os
import
os
from
test.support
import
verbose
,
TESTFN
,
run_unittest
,
unlink
from
test.support
import
verbose
,
TESTFN
,
unlink
filename
=
TESTFN
filename
=
TESTFN
...
@@ -81,8 +81,5 @@ class TestGdbm(unittest.TestCase):
...
@@ -81,8 +81,5 @@ class TestGdbm(unittest.TestCase):
self
.
assertTrue
(
size1
>
size2
>=
size0
)
self
.
assertTrue
(
size1
>
size2
>=
size0
)
def
test_main
():
run_unittest
(
TestGdbm
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_
main
()
unittest
.
main
()
Lib/test/test_dbm_ndbm.py
Dosyayı görüntüle @
f79493bf
...
@@ -36,8 +36,5 @@ class DbmTestCase(unittest.TestCase):
...
@@ -36,8 +36,5 @@ class DbmTestCase(unittest.TestCase):
except
error
:
except
error
:
self
.
fail
()
self
.
fail
()
def
test_main
():
support
.
run_unittest
(
DbmTestCase
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
test_
main
()
unittest
.
main
()
Misc/NEWS
Dosyayı görüntüle @
f79493bf
...
@@ -644,6 +644,9 @@ Tests
...
@@ -644,6 +644,9 @@ Tests
- Issue #15539: Added regression tests for Tools/scripts/pindent.py.
- Issue #15539: Added regression tests for Tools/scripts/pindent.py.
- Issue #17082: test_dbm* now work with unittest test discovery.
Patch by Zachary Ware.
- Issue #17079: test_ctypes now works with unittest test discovery.
- Issue #17079: test_ctypes now works with unittest test discovery.
Patch by Zachary Ware.
Patch by Zachary Ware.
...
...
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