Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(24)

#13349: Non-informative error message in index() and remove() functions

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 4 months ago by petri
Modified:
4 years, 3 months ago
Reviewers:
storchaka, sean.m.ochoa
CC:
terry.reedy, Nick Coghlan, haypo, ezio.melotti, eric.araujo, Julian, Petri Lehtinen, storchaka, bitcycle, Jim Fasarakis-Hilliard, emmanuelarias30_gmail.com
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Patch Set 3 #

Total comments: 14

Patch Set 4 #

Total comments: 8

Patch Set 5 #

Total comments: 5

Patch Set 6 #

Patch Set 7 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/test/test_array.py View 1 2 3 4 5 6 2 chunks +12 lines, -0 lines 0 comments Download
Lib/test/test_deque.py View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
Lib/test/test_list.py View 1 2 3 4 5 6 1 chunk +26 lines, -0 lines 0 comments Download
Lib/test/test_tuple.py View 1 2 3 4 5 6 1 chunk +19 lines, -0 lines 0 comments Download
Lib/test/test_xml_etree.py View 1 2 3 4 5 6 2 chunks +16 lines, -3 lines 0 comments Download
Modules/_collectionsmodule.c View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
Modules/_elementtree.c View 1 2 3 4 5 6 2 chunks +2 lines, -8 lines 0 comments Download
Modules/arraymodule.c View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
Objects/listobject.c View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
Objects/tupleobject.c View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4
storchaka_gmail.com
Tests for collection.index needed. http://bugs.python.org/review/13349/diff/6544/Lib/test/test_array.py File Lib/test/test_array.py (right): http://bugs.python.org/review/13349/diff/6544/Lib/test/test_array.py#newcode98 Lib/test/test_array.py:98: def test_issue13349(self): I prefer "test_remove" ...
4 years, 4 months ago #1
bitcycle
http://bugs.python.org/review/13349/diff/6544/Lib/test/test_array.py File Lib/test/test_array.py (right): http://bugs.python.org/review/13349/diff/6544/Lib/test/test_array.py#newcode101 Lib/test/test_array.py:101: with self.assertRaises(ValueError) as ve: That's what I started with, ...
4 years, 4 months ago #2
storchaka_gmail.com
http://bugs.python.org/review/13349/diff/6553/Lib/test/test_array.py File Lib/test/test_array.py (right): http://bugs.python.org/review/13349/diff/6553/Lib/test/test_array.py#newcode103 Lib/test/test_array.py:103: self.assertIn(repr(item), str(ve.exception)) If you prefer assertRaises(), please add self.assertRegex(str(ve.exception), ...
4 years, 4 months ago #3
storchaka_gmail.com
4 years, 4 months ago #4
http://bugs.python.org/review/13349/diff/6575/Lib/test/test_list.py
File Lib/test/test_list.py (right):

http://bugs.python.org/review/13349/diff/6575/Lib/test/test_list.py#newcode113
Lib/test/test_list.py:113: lst.index(3)
self.assertEqual([1, 2, 3].index(2), 1)
self.assertEqual([1, 2, 3].index(2.0), 1)

http://bugs.python.org/review/13349/diff/6575/Lib/test/test_list.py#newcode128
Lib/test/test_list.py:128: lst.append(item)
lst = [1, 2, 3, 1]

http://bugs.python.org/review/13349/diff/6575/Lib/test/test_list.py#newcode130
Lib/test/test_list.py:130: self.assertEqual(item, lst.pop())
self.assertEqual(lst, [2, 3, 1])

Also add test for remove float from list of integers.

http://bugs.python.org/review/13349/diff/6575/Lib/test/test_tuple.py
File Lib/test/test_tuple.py (right):

http://bugs.python.org/review/13349/diff/6575/Lib/test/test_tuple.py#newcode28
Lib/test/test_tuple.py:28: tpl.index(item)
self.assertEqual((1, 2, 3).index(2), 1)
self.assertEqual((1, 2, 3).index(2.0), 1)

http://bugs.python.org/review/13349/diff/6575/Lib/test/test_xml_etree.py
File Lib/test/test_xml_etree.py (right):

http://bugs.python.org/review/13349/diff/6575/Lib/test/test_xml_etree.py#newc...
Lib/test/test_xml_etree.py:1896: elem.remove(item)
Failed.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7