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
cbfe07e0
Kaydet (Commit)
cbfe07e0
authored
May 20, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 24215: Added tests for more builtin types in test_pprint.
Made test_pprint and test_trace discoverable.
üst
c0e0022f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
17 deletions
+12
-17
test_pprint.py
Lib/test/test_pprint.py
+8
-9
test_trace.py
Lib/test/test_trace.py
+4
-8
No files found.
Lib/test/test_pprint.py
Dosyayı görüntüle @
cbfe07e0
...
...
@@ -58,7 +58,8 @@ class QueryTestCase(unittest.TestCase):
def
test_basic
(
self
):
# Verify .isrecursive() and .isreadable() w/o recursion
pp
=
pprint
.
PrettyPrinter
()
for
safe
in
(
2
,
2.0
,
2
j
,
"abc"
,
[
3
],
(
2
,
2
),
{
3
:
3
},
"yaddayadda"
,
for
safe
in
(
2
,
2.0
,
2
j
,
"abc"
,
[
3
],
(
2
,
2
),
{
3
:
3
},
b
"def"
,
bytearray
(
b
"ghi"
),
True
,
False
,
None
,
...
,
self
.
a
,
self
.
b
):
# module-level convenience functions
self
.
assertFalse
(
pprint
.
isrecursive
(
safe
),
...
...
@@ -128,21 +129,23 @@ class QueryTestCase(unittest.TestCase):
# it sorted a dict display if and only if the display required
# multiple lines. For that reason, dicts with more than one element
# aren't tested here.
for
simple
in
(
0
,
0
,
0
+
0
j
,
0.0
,
""
,
b
""
,
for
simple
in
(
0
,
0
,
0
+
0
j
,
0.0
,
""
,
b
""
,
bytearray
(),
(),
tuple2
(),
tuple3
(),
[],
list2
(),
list3
(),
set
(),
set2
(),
set3
(),
frozenset
(),
frozenset2
(),
frozenset3
(),
{},
dict2
(),
dict3
(),
self
.
assertTrue
,
pprint
,
-
6
,
-
6
,
-
6
-
6
j
,
-
1.5
,
"x"
,
b
"x"
,
(
3
,),
[
3
],
{
3
:
6
},
-
6
,
-
6
,
-
6
-
6
j
,
-
1.5
,
"x"
,
b
"x"
,
bytearray
(
b
"x"
),
(
3
,),
[
3
],
{
3
:
6
},
(
1
,
2
),
[
3
,
4
],
{
5
:
6
},
tuple2
((
1
,
2
)),
tuple3
((
1
,
2
)),
tuple3
(
range
(
100
)),
[
3
,
4
],
list2
([
3
,
4
]),
list3
([
3
,
4
]),
list3
(
range
(
100
)),
set
({
7
}),
set2
({
7
}),
set3
({
7
}),
frozenset
({
8
}),
frozenset2
({
8
}),
frozenset3
({
8
}),
dict2
({
5
:
6
}),
dict3
({
5
:
6
}),
range
(
10
,
-
11
,
-
1
)
range
(
10
,
-
11
,
-
1
),
True
,
False
,
None
,
...
,
):
native
=
repr
(
simple
)
self
.
assertEqual
(
pprint
.
pformat
(
simple
),
native
)
...
...
@@ -597,9 +600,5 @@ class DottedPrettyPrinter(pprint.PrettyPrinter):
self
,
object
,
context
,
maxlevels
,
level
)
def
test_main
():
test
.
support
.
run_unittest
(
QueryTestCase
)
if
__name__
==
"__main__"
:
test_
main
()
unittest
.
main
()
Lib/test/test_trace.py
Dosyayı görüntüle @
cbfe07e0
import
os
import
io
import
sys
from
test.support
import
(
run_unittest
,
TESTFN
,
rmtree
,
unlink
,
captured_stdout
)
from
test.support
import
TESTFN
,
rmtree
,
unlink
,
captured_stdout
import
unittest
import
trace
...
...
@@ -297,7 +296,8 @@ class TestCoverage(unittest.TestCase):
unlink
(
TESTFN
)
def
_coverage
(
self
,
tracer
,
cmd
=
'from test import test_pprint; test_pprint.test_main()'
):
cmd
=
'import test.support, test.test_pprint;'
'test.support.run_unittest(test.test_pprint.QueryTestCase)'
):
tracer
.
run
(
cmd
)
r
=
tracer
.
results
()
r
.
write_results
(
show_missing
=
True
,
summary
=
True
,
coverdir
=
TESTFN
)
...
...
@@ -407,9 +407,5 @@ class TestDeprecatedMethods(unittest.TestCase):
trace
.
find_executable_linenos
(
fd
.
name
)
def
test_main
():
run_unittest
(
__name__
)
if
__name__
==
'__main__'
:
test_
main
()
unittest
.
main
()
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