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
d1ef8542
Kaydet (Commit)
d1ef8542
authored
Ock 11, 2008
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Run doctests on the collections module
üst
15b5e55b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
collections.rst
Doc/library/collections.rst
+1
-1
test_collections.py
Lib/test/test_collections.py
+4
-2
No files found.
Doc/library/collections.rst
Dosyayı görüntüle @
d1ef8542
...
...
@@ -502,7 +502,7 @@ function::
>>> getattr(p, 'x')
11
To c
as
t a dictionary to a named tuple, use the double-star-operator [#]_::
To c
onver
t a dictionary to a named tuple, use the double-star-operator [#]_::
>>> d = {'x': 11, 'y': 22}
>>> Point(**d)
...
...
Lib/test/test_collections.py
Dosyayı görüntüle @
d1ef8542
import
unittest
import
unittest
,
doctest
from
test
import
test_support
from
collections
import
namedtuple
from
collections
import
Hashable
,
Iterable
,
Iterator
...
...
@@ -304,10 +304,12 @@ class TestCollectionABCs(unittest.TestCase):
self
.
failUnless
(
issubclass
(
sample
,
MutableSequence
))
self
.
failIf
(
issubclass
(
basestring
,
MutableSequence
))
import
doctest
,
collections
NamedTupleDocs
=
doctest
.
DocTestSuite
(
module
=
collections
)
def
test_main
(
verbose
=
None
):
import
collections
as
CollectionsModule
test_classes
=
[
TestNamedTuple
,
TestOneTrickPonyABCs
,
TestCollectionABCs
]
test_classes
=
[
TestNamedTuple
,
NamedTupleDocs
,
TestOneTrickPonyABCs
,
TestCollectionABCs
]
test_support
.
run_unittest
(
*
test_classes
)
test_support
.
run_doctest
(
CollectionsModule
,
verbose
)
...
...
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