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
c944cfc7
Kaydet (Commit)
c944cfc7
authored
Eyl 21, 2010
tarafından
Daniel Stutzbach
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue9131: Mark fragile test as CPython-specific
üst
2f816e6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
test_pprint.py
Lib/test/test_pprint.py
+22
-0
No files found.
Lib/test/test_pprint.py
Dosyayı görüntüle @
c944cfc7
...
@@ -219,7 +219,29 @@ class QueryTestCase(unittest.TestCase):
...
@@ -219,7 +219,29 @@ class QueryTestCase(unittest.TestCase):
others.should.not.be: like.this}"""
others.should.not.be: like.this}"""
self
.
assertEqual
(
DottedPrettyPrinter
()
.
pformat
(
o
),
exp
)
self
.
assertEqual
(
DottedPrettyPrinter
()
.
pformat
(
o
),
exp
)
@test.support.cpython_only
def
test_set_reprs
(
self
):
def
test_set_reprs
(
self
):
# This test creates a complex arrangement of frozensets and
# compares the pretty-printed repr against a string hard-coded in
# the test. The hard-coded repr depends on the sort order of
# frozensets.
#
# However, as the docs point out: "Since sets only define
# partial ordering (subset relationships), the output of the
# list.sort() method is undefined for lists of sets."
#
# In a nutshell, the test assumes frozenset({0}) will always
# sort before frozenset({1}), but:
#
# >>> frozenset({0}) < frozenset({1})
# False
# >>> frozenset({1}) < frozenset({0})
# False
#
# Consequently, this test is fragile and
# implementation-dependent. Small changes to Python's sort
# algorithm cause the test to fail when it should pass.
self
.
assertEqual
(
pprint
.
pformat
(
set
()),
'set()'
)
self
.
assertEqual
(
pprint
.
pformat
(
set
()),
'set()'
)
self
.
assertEqual
(
pprint
.
pformat
(
set
(
range
(
3
))),
'{0, 1, 2}'
)
self
.
assertEqual
(
pprint
.
pformat
(
set
(
range
(
3
))),
'{0, 1, 2}'
)
self
.
assertEqual
(
pprint
.
pformat
(
frozenset
()),
'frozenset()'
)
self
.
assertEqual
(
pprint
.
pformat
(
frozenset
()),
'frozenset()'
)
...
...
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