[issue10273] Clean-up Unittest API

2010-12-09 Thread Gregory P. Smith
Gregory P. Smith added the comment: fyi - since I didn't chime in earlier on this: I think you made the right choice with what was decided in msg122413 and implemented in the renaming done in r86910 and the work done in issue10242. -- ___ Python tr

[issue10273] Clean-up Unittest API

2010-11-30 Thread Ezio Melotti
Ezio Melotti added the comment: s/regexp/regex/ done in r86910. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___

[issue10273] Clean-up Unittest API

2010-11-29 Thread Michael Foord
Michael Foord added the comment: Raymond - I created a new issue for moving the tests: issue 10572 However, it seems that you are incorrect in saying that Python practise is to avoid putting tests inside standard library packages. In fact current Python practise seems to be that where tests t

[issue10273] Clean-up Unittest API

2010-11-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Ezio, please do the regexp-->regex changes and move the tests under Lib/test. -- assignee: rhettinger -> ezio.melotti ___ Python tracker ___

[issue10273] Clean-up Unittest API

2010-11-25 Thread Ezio Melotti
Ezio Melotti added the comment: If I implement what I suggested in #10535, it will be possible to deprecate them without too much trouble. I offer to do it after #10535. -- ___ Python tracker

[issue10273] Clean-up Unittest API

2010-11-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Yes, all the variants of RegexpMatches --> Regex No, on deprecations. Just add a new alias and note in the docs that the oldname is obsolete. Naming deprecations cause too much trouble for too little benefit. --

[issue10273] Clean-up Unittest API

2010-11-25 Thread Ezio Melotti
Ezio Melotti added the comment: > * Moving the docs for type specific equality methods inside the docs for > assertEqual to emphasize that those get dispatched automatically and need not > be called directly. I already fixed this on py3k, adding a section where the type-specific methods are

[issue10273] Clean-up Unittest API

2010-11-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: After discussion with Michael and Guido, am limiting this to: * Fixing assertItemsEqual as described in issue10242 * Moving the docs for type specific equality methods inside the docs for assertEqual to emphasize that those get dispatched automatically and

[issue10273] Clean-up Unittest API

2010-11-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: > people who are used to the current spelling > will have to notice the change, note that one > name is now deprecated I haven't proposed any deprecations. Just add the new names as aliases. Change the docs list the new names as primary and mention the old

[issue10273] Clean-up Unittest API

2010-11-05 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue10273] Clean-up Unittest API

2010-11-04 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +flox, gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue10273] Clean-up Unittest API

2010-11-04 Thread Ezio Melotti
Ezio Melotti added the comment: It should be noted that, if we re-use assertSameElements, the default behavior should be preserved for compatibility with 3.1, and that is different (and possibly less useful) than the one of assertItemsEqual. Ambiguities could be solved easily specifying the a

[issue10273] Clean-up Unittest API

2010-11-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: > assertLess, on the other hand, I often get wrong, > since it is *not* __lt__ spelled out. Right. Even Michael gets that one wrong. Meditate on why Guido created the special method __lt__ instead of __less_than__. Regardless of why Guido made that choi

[issue10273] Clean-up Unittest API

2010-11-03 Thread R. David Murray
R. David Murray added the comment: assertCountsEqual is IMO much clearer than assertItemsCountsEqual (or however you spell it). I was unclear on what the latter did, but the former is fairly clear. Ezio's suggestion is also clearer. Raymond, since you said 'never' your statement about asser

[issue10273] Clean-up Unittest API

2010-11-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: > For the regexp methods we should use assertRegexp assertRegex is better. it matches the name used in other unittest implementations, there is not confusion with camel casing RegExp vs Regexp, and it matches the former name of Python's own regex module.

[issue10273] Clean-up Unittest API

2010-11-03 Thread Ezio Melotti
Ezio Melotti added the comment: An alternative would be adding check_order and check_duplicates to assertSameElements and de-deprecate it. Python 2.7 could be left unchanged because it's too late to add/rename/deprecate methods (it has assertItemsEqual but not assertSameElements). Py3.2 woul

[issue10273] Clean-up Unittest API

2010-11-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: > For assertItemsEqual Raymond suggests assertElementCountsEqual. See > issue 10242. Why replace a long awkward name with an even longer and more awkward name? -- ___ Python tracker

[issue10273] Clean-up Unittest API

2010-11-03 Thread Michael Foord
Michael Foord added the comment: Renaming and aliasing methods has a cost. It confuses users of the old names (including future users - the current API is now baked into django 1.3 unless I can get an update done in time for them to change the version they're using). People who use autocomple

[issue10273] Clean-up Unittest API

2010-11-03 Thread R. David Murray
R. David Murray added the comment: assertEquals existed forever, too, but we deprecated that :) (with no intent to remove it, as I understand it). There is no more ambiguity in "assertLessThan" than there is in assertLT, one just has more letters. True, you have to look it up the first time,

[issue10273] Clean-up Unittest API

2010-11-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Besides being shorter, the advantages of assertLE are consistent with the rich comparison method names, no worries about Than, no camel casing ambiguities, no pluralization or other nmemonic issues (LessThanEqual or LessThanEquals or LessThanOrEqual or Les

[issue10273] Clean-up Unittest API

2010-11-02 Thread R. David Murray
R. David Murray added the comment: I don't think assertLE is enough of an improvement over assertLessEqual to be worth adding yet more deprecated names to unittest. So I'm -0 on this change in general. (I'd be -1 except that it would be kind of nice to have the names be shorter :) If the ch

[issue10273] Clean-up Unittest API

2010-11-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: After discussion on python-dev, it seems that API lock-in precludes any change to the package structure. So, the main proposals left are the addition of new better aliases for some of the functions and changing to the docs so that the new name is clear:

[issue10273] Clean-up Unittest API

2010-11-02 Thread Michael Foord
Michael Foord added the comment: @Ezio Good catch. Even though several of us (including myself) prefer assertRegex over assertRegexp it is probably better to have consistent APIs otherwise people will never remember which methods have the 'p' and which don't. --

[issue10273] Clean-up Unittest API

2010-11-02 Thread Ezio Melotti
Ezio Melotti added the comment: FWIW in addition to assertRegexpMatches and assertNotRegexpMatches there are 2 more methods that use "Regexp": assertRaisesRegexp and the newly introduced assertWarnsRegexp. -- components: +Tests ___ Python tracker

[issue10273] Clean-up Unittest API

2010-11-01 Thread Brett Cannon
Brett Cannon added the comment: Just sent an email to python-dev, but since this issue sparked it, I might as well comment here: unittest shouldn't be made back into a single module. Ignoring the fact that the file structure has nothing to do with the public API and so is orthogonal to the ma

[issue10273] Clean-up Unittest API

2010-11-01 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: michael.foord -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue10273] Clean-up Unittest API

2010-11-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Antoine] > I would prefer assertRegex to assertRegexp That makes sense. It is the name used in other unittest implementations, it matches what the re module used to be called in Python, and it avoids issues with camel casing (i.e. Regexp vs RegExp). ---

[issue10273] Clean-up Unittest API

2010-11-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Just my 2 cents: - I think dedocumenting the type-specific methods is fine (it doesn't mean removing them, though); or perhaps relegate them to some advanced section - It's unfortunate that the renaming suggestion comes so late; I'm not sure it's a good idea

[issue10273] Clean-up Unittest API

2010-11-01 Thread Ezio Melotti
Ezio Melotti added the comment: * I would leave assertEqual documented and specify that they should be called directly only if the type should be checked, otherwise (if the type doesn't matter or it's already tested elsewhere) using assertEqual is enough (see also the suggestions in msg120124

[issue10273] Clean-up Unittest API

2010-10-31 Thread Michael Foord
Michael Foord added the comment: In general *none* of this should be done until there is clear consensus on Python-dev and it isn't clear that this is the case. * On the deocumenting: barry warsaw objects to public apis that aren't documented and gregory smith asserts (natch) that it *can* be

[issue10273] Clean-up Unittest API

2010-10-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would prefer assertRegex to assertRegexp. -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs

[issue10273] Clean-up Unittest API

2010-10-31 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti, michael.foord ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10273] Clean-up Unittest API

2010-10-31 Thread Raymond Hettinger
New submission from Raymond Hettinger : * Dedocument assertSetEqual, assertDictEqual, assertListEqual, and assertTupleEqual. These are all automatically dispatched from assertEqual. The user need not call any of these directly. These methods should not have been exposed in the docs. * Add