[issue12581] Increased test coverage of test_urlparse

2011-07-23 Thread R. David Murray
R. David Murray added the comment: Exhaustion of the iterator is easily solved by simply retaining a reference to it and iterating that (which is what I had in mind). However, I had not thought about the problem of an *in*exhaustable iterator, and to cover that case len is indeed better. --

[issue12581] Increased test coverage of test_urlparse

2011-07-23 Thread Senthil Kumaran
Senthil Kumaran added the comment: Thanks a lot for the patch, Petter Haggholm. I was initially hesitant to have separate tests for functions/methods which are helper functions and not necessarily have documented api. My thought was that those should be tested as part of the public api. But on

[issue12581] Increased test coverage of test_urlparse

2011-07-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset e171db785c37 by Senthil Kumaran in branch '3.2': Fix closes issue12581 - Increase the urllib.parse test coverage. Patch by Petter Haggholm. http://hg.python.org/cpython/rev/e171db785c37 New changeset fcccda3c546f by Senthil Kumaran in branch 'defa

[issue12581] Increased test coverage of test_urlparse

2011-07-23 Thread Senthil Kumaran
Senthil Kumaran added the comment: On Sat, Jul 23, 2011 at 09:37:27AM +, Éric Araujo wrote: > I’ve had a look at the docstring and the reST docs, and they clearly > say that sequences are supported, not arbitrary iterables. Yeah. At the first cut, when I saw the suggestion of iter(), I thou

[issue12581] Increased test coverage of test_urlparse

2011-07-23 Thread Éric Araujo
Éric Araujo added the comment: Peter’s patch now uses iter(thing) instead of len(thing) to assess sequenciness. I made this comment: > You can iterate over an iterator (which is not a sequence). Here I > don’t know if the code talks about sequence because it pre-dates > iterators or because it

[issue12581] Increased test coverage of test_urlparse

2011-07-21 Thread Petter Haggholm
Petter Haggholm added the comment: Added suggested changes from review, removed (rather useless) repr test; left parse.py changes alone (see review comments for rationale) -- Added file: http://bugs.python.org/file22715/urlparsetest.patch ___ Python

[issue12581] Increased test coverage of test_urlparse

2011-07-21 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue12581] Increased test coverage of test_urlparse

2011-07-20 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo versions: +Python 2.7, Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue12581] Increased test coverage of test_urlparse

2011-07-19 Thread Senthil Kumaran
Senthil Kumaran added the comment: Hi Petter, writing tests are ofcourse a good way to start. As long as the tests increase the coverage, those are most welcome. Thanks! -- assignee: -> orsenthil ___ Python tracker

[issue12581] Increased test coverage of test_urlparse

2011-07-18 Thread Petter Haggholm
Petter Haggholm added the comment: It’s my pleasure — it’s very trivial, but hopefully it’ll get my feet wet and get me in a place where I am familiar enough with procedures and things to contribute something relevant. :) Attaching a modified patch with (1) reversion to duck typing in parse.p

[issue12581] Increased test coverage of test_urlparse

2011-07-18 Thread R. David Murray
Changes by R. David Murray : -- nosy: +orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue12581] Increased test coverage of test_urlparse

2011-07-18 Thread R. David Murray
R. David Murray added the comment: I haven't reviewed your tests, but a couple quick comments: we generally prefer duck typing to the use of isintance or ABCs, but sometimes the latter is better (it's a judgement call). I haven't done a deep dive in the code you modified, but from the looks

[issue12581] Increased test coverage of test_urlparse

2011-07-17 Thread Petter Haggholm
New submission from Petter Haggholm : Some very trivial tests to increase the test coverage on test_urlparse a bit; also changed a single line to use an ABC instead of attempting to use len() to verify that an object is "sequence-like" (as the comment put it). Mostly I’m trying to get my feet