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
5eed36fa
Commit
5eed36fa
authored
Jan 07, 2017
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #29200: Fix test to use self.assertEqual instead of py.test style tests
parent
d191ef25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
Lib/test/test_functools.py
Lib/test/test_functools.py
+12
-12
No files found.
Lib/test/test_functools.py
View file @
5eed36fa
...
...
@@ -1207,24 +1207,24 @@ class TestLRU:
mock_int
.
__hash__
=
unittest
.
mock
.
Mock
(
return_value
=
999
)
# Add to cache: One use as an argument gives one call
assert
f
(
mock_int
,
1
)
==
16
assert
mock_int
.
__hash__
.
call_count
==
1
assert
f
.
cache_info
()
==
(
0
,
1
,
1
,
1
)
self
.
assertEqual
(
f
(
mock_int
,
1
),
16
)
self
.
assertEqual
(
mock_int
.
__hash__
.
call_count
,
1
)
self
.
assertEqual
(
f
.
cache_info
(),
(
0
,
1
,
1
,
1
)
)
# Cache hit: One use as an argument gives one additional call
assert
f
(
mock_int
,
1
)
==
16
assert
mock_int
.
__hash__
.
call_count
==
2
assert
f
.
cache_info
()
==
(
1
,
1
,
1
,
1
)
self
.
assertEqual
(
f
(
mock_int
,
1
),
16
)
self
.
assertEqual
(
mock_int
.
__hash__
.
call_count
,
2
)
self
.
assertEqual
(
f
.
cache_info
(),
(
1
,
1
,
1
,
1
)
)
# Cache eviction: No use as an argument gives no additonal call
assert
f
(
6
,
2
)
==
20
assert
mock_int
.
__hash__
.
call_count
==
2
assert
f
.
cache_info
()
==
(
1
,
2
,
1
,
1
)
self
.
assertEqual
(
f
(
6
,
2
),
20
)
self
.
assertEqual
(
mock_int
.
__hash__
.
call_count
,
2
)
self
.
assertEqual
(
f
.
cache_info
(),
(
1
,
2
,
1
,
1
)
)
# Cache miss: One use as an argument gives one additional call
assert
f
(
mock_int
,
1
)
==
16
assert
mock_int
.
__hash__
.
call_count
==
3
assert
f
.
cache_info
()
==
(
1
,
3
,
1
,
1
)
self
.
assertEqual
(
f
(
mock_int
,
1
),
16
)
self
.
assertEqual
(
mock_int
.
__hash__
.
call_count
,
3
)
self
.
assertEqual
(
f
.
cache_info
(),
(
1
,
3
,
1
,
1
)
)
def
test_lru_reentrancy_with_len
(
self
):
# Test to make sure the LRU cache code isn't thrown-off by
...
...
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