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
efbcb1b0
Commit
efbcb1b0
authored
Dec 24, 2010
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep helper functions private.
parent
9d668dac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
Lib/unittest/util.py
Lib/unittest/util.py
+2
-2
No files found.
Lib/unittest/util.py
View file @
efbcb1b0
...
@@ -116,7 +116,7 @@ def _count_diff_all_purpose(actual, expected):
...
@@ -116,7 +116,7 @@ def _count_diff_all_purpose(actual, expected):
result
.
append
(
diff
)
result
.
append
(
diff
)
return
result
return
result
def
ordered_count
(
iterable
):
def
_
ordered_count
(
iterable
):
'Return dict of element counts, in the order they were first seen'
'Return dict of element counts, in the order they were first seen'
c
=
OrderedDict
()
c
=
OrderedDict
()
for
elem
in
iterable
:
for
elem
in
iterable
:
...
@@ -126,7 +126,7 @@ def ordered_count(iterable):
...
@@ -126,7 +126,7 @@ def ordered_count(iterable):
def
_count_diff_hashable
(
actual
,
expected
):
def
_count_diff_hashable
(
actual
,
expected
):
'Returns list of (cnt_act, cnt_exp, elem) triples where the counts differ'
'Returns list of (cnt_act, cnt_exp, elem) triples where the counts differ'
# elements must be hashable
# elements must be hashable
s
,
t
=
ordered_count
(
actual
),
ordered_count
(
expected
)
s
,
t
=
_ordered_count
(
actual
),
_
ordered_count
(
expected
)
result
=
[]
result
=
[]
for
elem
,
cnt_s
in
s
.
items
():
for
elem
,
cnt_s
in
s
.
items
():
cnt_t
=
t
.
get
(
elem
,
0
)
cnt_t
=
t
.
get
(
elem
,
0
)
...
...
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