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
d702c500
Commit
d702c500
authored
Mar 27, 2017
by
Jim Fasarakis-Hilliard
Committed by
Brett Cannon
Mar 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-29912: Remove redundant tests in list_tests that are found in seq_tests (GH-847)
parent
d6debb24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
63 deletions
+4
-63
Lib/test/list_tests.py
Lib/test/list_tests.py
+2
-63
Lib/test/seq_tests.py
Lib/test/seq_tests.py
+2
-0
No files found.
Lib/test/list_tests.py
View file @
d702c500
...
...
@@ -354,66 +354,9 @@ class CommonTest(seq_tests.CommonTest):
# verify that original order and values are retained.
self
.
assertIs
(
x
,
y
)
def
test_count
(
self
):
a
=
self
.
type2test
([
0
,
1
,
2
])
*
3
self
.
assertEqual
(
a
.
count
(
0
),
3
)
self
.
assertEqual
(
a
.
count
(
1
),
3
)
self
.
assertEqual
(
a
.
count
(
3
),
0
)
self
.
assertRaises
(
TypeError
,
a
.
count
)
class
BadExc
(
Exception
):
pass
class
BadCmp
:
def
__eq__
(
self
,
other
):
if
other
==
2
:
raise
BadExc
()
return
False
self
.
assertRaises
(
BadExc
,
a
.
count
,
BadCmp
())
def
test_index
(
self
):
u
=
self
.
type2test
([
0
,
1
])
self
.
assertEqual
(
u
.
index
(
0
),
0
)
self
.
assertEqual
(
u
.
index
(
1
),
1
)
self
.
assertRaises
(
ValueError
,
u
.
index
,
2
)
u
=
self
.
type2test
([
-
2
,
-
1
,
0
,
0
,
1
,
2
])
self
.
assertEqual
(
u
.
count
(
0
),
2
)
self
.
assertEqual
(
u
.
index
(
0
),
2
)
self
.
assertEqual
(
u
.
index
(
0
,
2
),
2
)
self
.
assertEqual
(
u
.
index
(
-
2
,
-
10
),
0
)
self
.
assertEqual
(
u
.
index
(
0
,
3
),
3
)
self
.
assertEqual
(
u
.
index
(
0
,
3
,
4
),
3
)
self
.
assertRaises
(
ValueError
,
u
.
index
,
2
,
0
,
-
10
)
self
.
assertRaises
(
TypeError
,
u
.
index
)
class
BadExc
(
Exception
):
pass
class
BadCmp
:
def
__eq__
(
self
,
other
):
if
other
==
2
:
raise
BadExc
()
return
False
a
=
self
.
type2test
([
0
,
1
,
2
,
3
])
self
.
assertRaises
(
BadExc
,
a
.
index
,
BadCmp
())
super
().
test_index
()
a
=
self
.
type2test
([
-
2
,
-
1
,
0
,
0
,
1
,
2
])
self
.
assertEqual
(
a
.
index
(
0
),
2
)
self
.
assertEqual
(
a
.
index
(
0
,
2
),
2
)
self
.
assertEqual
(
a
.
index
(
0
,
-
4
),
2
)
self
.
assertEqual
(
a
.
index
(
-
2
,
-
10
),
0
)
self
.
assertEqual
(
a
.
index
(
0
,
3
),
3
)
self
.
assertEqual
(
a
.
index
(
0
,
-
3
),
3
)
self
.
assertEqual
(
a
.
index
(
0
,
3
,
4
),
3
)
self
.
assertEqual
(
a
.
index
(
0
,
-
3
,
-
2
),
3
)
self
.
assertEqual
(
a
.
index
(
0
,
-
4
*
sys
.
maxsize
,
4
*
sys
.
maxsize
),
2
)
self
.
assertRaises
(
ValueError
,
a
.
index
,
0
,
4
*
sys
.
maxsize
,
-
4
*
sys
.
maxsize
)
self
.
assertRaises
(
ValueError
,
a
.
index
,
2
,
0
,
-
10
)
a
.
remove
(
0
)
self
.
assertRaises
(
ValueError
,
a
.
index
,
2
,
0
,
4
)
self
.
assertEqual
(
a
,
self
.
type2test
([
-
2
,
-
1
,
0
,
1
,
2
]))
...
...
@@ -548,11 +491,7 @@ class CommonTest(seq_tests.CommonTest):
self
.
assertRaises
(
TypeError
,
u
.
__iadd__
,
None
)
def
test_imul
(
self
):
u
=
self
.
type2test
([
0
,
1
])
u
*=
3
self
.
assertEqual
(
u
,
self
.
type2test
([
0
,
1
,
0
,
1
,
0
,
1
]))
u
*=
0
self
.
assertEqual
(
u
,
self
.
type2test
([]))
super
().
test_imul
()
s
=
self
.
type2test
([])
oldid
=
id
(
s
)
s
*=
10
...
...
Lib/test/seq_tests.py
View file @
d702c500
...
...
@@ -301,6 +301,8 @@ class CommonTest(unittest.TestCase):
u
=
self
.
type2test
([
0
,
1
])
u
*=
3
self
.
assertEqual
(
u
,
self
.
type2test
([
0
,
1
,
0
,
1
,
0
,
1
]))
u
*=
0
self
.
assertEqual
(
u
,
self
.
type2test
([]))
def
test_getitemoverwriteiter
(
self
):
# Verify that __getitem__ overrides are not recognized by __iter__
...
...
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