Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2d7b91ce
Commit
2d7b91ce
authored
Nov 06, 2010
by
Eric Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unused test classes from test_format_map().
parent
979e8e31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
38 deletions
+0
-38
Lib/test/test_unicode.py
Lib/test/test_unicode.py
+0
-38
No files found.
Lib/test/test_unicode.py
View file @
2d7b91ce
...
...
@@ -720,49 +720,11 @@ class UnicodeTest(string_tests.CommonTest,
self
.
assertEqual
(
'{a}'
.
format_map
(
InternalMapping
()),
'hello'
)
# classes we'll use for testing
class
C
:
def
__init__
(
self
,
x
=
100
):
self
.
_x
=
x
def
__format__
(
self
,
spec
):
return
spec
class
D
:
def
__init__
(
self
,
x
):
self
.
x
=
x
def
__format__
(
self
,
spec
):
return
str
(
self
.
x
)
# class with __str__, but no __format__
class
E
:
def
__init__
(
self
,
x
):
self
.
x
=
x
def
__str__
(
self
):
return
'E('
+
self
.
x
+
')'
# class with __repr__, but no __format__ or __str__
class
F
:
def
__init__
(
self
,
x
):
self
.
x
=
x
def
__repr__
(
self
):
return
'F('
+
self
.
x
+
')'
# class with __format__ that forwards to string, for some format_spec's
class
G
:
def
__init__
(
self
,
x
):
self
.
x
=
x
def
__str__
(
self
):
return
"string is "
+
self
.
x
def
__format__
(
self
,
format_spec
):
if
format_spec
==
'd'
:
return
'G('
+
self
.
x
+
')'
return
object
.
__format__
(
self
,
format_spec
)
# class that returns a bad type from __format__
class
H
:
def
__format__
(
self
,
format_spec
):
return
1.0
self
.
assertEqual
(
'{foo._x}'
.
format_map
({
'foo'
:
C
(
20
)}),
'20'
)
# test various errors
...
...
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