[issue10573] Consistency in unittest assert methods: order of actual, expected

2011-01-28 Thread Michael Foord
Changes by Michael Foord : -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue10573] Consistency in unittest assert methods: order of actual, expected

2011-01-28 Thread R. David Murray
R. David Murray added the comment: Code patch looks good to me. Unittest tests pass. -- nosy: +r.david.murray ___ Python tracker ___ ___

[issue10573] Consistency in unittest assert methods: order of actual, expected

2011-01-28 Thread Michael Foord
Michael Foord added the comment: Patch to docs and minor change to assertCountEqual to not use actual / expected internally. -- Added file: http://bugs.python.org/file20580/expected-actual.diff ___ Python tracker

[issue10573] Consistency in unittest assert methods: order of actual, expected

2011-01-23 Thread Michael Foord
Michael Foord added the comment: Note that I looked at making the sequence comparison code symmetric - but it generates nice diffs for even nested containers by using prettyprint and difflib. Switching to a symmetric output ("in first, not in second" etc) would be very difficult without losin

[issue10573] Consistency in unittest assert methods: order of actual, expected

2011-01-23 Thread Michael Foord
Michael Foord added the comment: There was a BDFL ruling on python-dev mailing list that assert argument names should be (first, second). See: http://mail.python.org/pipermail/python-dev/2010-December/106954.html I'm basically reverting the patch to go back to (first, second) in the docs an

[issue10573] Consistency in unittest assert methods: order of actual, expected

2011-01-20 Thread Ezio Melotti
Ezio Melotti added the comment: Not all the arg names in the doc match with the actual name of the args (probably because the methods are expected to be used with positional args only), that's why the changes affects only the doc. -- ___ Python tra

[issue10573] Consistency in unittest assert methods: order of actual, expected

2010-12-26 Thread Ron Adam
Ron Adam added the comment: The issue10573.diff file with the time stamp 20:03 has a lot of document changes that don't have corresponding code changes? -- nosy: +ron_adam ___ Python tracker _

[issue10573] Consistency in unittest assert methods: order of actual, expected

2010-12-18 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed in r87389. This can be backported to 3.1/2.7 where applicable. -- stage: needs patch -> commit review Added file: http://bugs.python.org/file20105/issue10573.diff ___ Python tracker

[issue10573] Consistency in unittest assert methods: order of actual, expected

2010-12-18 Thread Michael Foord
Michael Foord added the comment: The argument order doesn't match the name (which isn't a huge deal I don't think) - but subset in dict does match the element in container order of assertIn. -- ___ Python tracker

[issue10573] Consistency in unittest assert methods: order of actual, expected

2010-12-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: These three changes look fine. The argument order for assertDictContainsSubset is problematic (doesn't match its own name and doesn't match the order for other __contains__ methods elsewhere in Python), but it's too late to change it now :-( --

[issue10573] Consistency in unittest assert methods: order of actual, expected

2010-12-18 Thread Georg Brandl
Georg Brandl added the comment: If Michael and Raymond reach a consensus, this can go in before beta2. -- nosy: +georg.brandl ___ Python tracker ___

[issue10573] Consistency in unittest assert methods: order of actual, expected

2010-12-18 Thread Ezio Melotti
Ezio Melotti added the comment: The attached patch changes the following things - assertDictContainsSubset(expected, actual, msg=None) + assertDictContainsSubset(subset, dictionary, msg=None) This doesn't change the order of the args, even though the name of the method might suggest the opposi

[issue10573] Consistency in unittest assert methods: order of actual, expected

2010-12-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: This should get fixed-up before the second beta. Try to confirm the most common argument ordering using Google's code search to ascertain actual practice in real code. FWIW, I also tend to use actual/expected and find the reverse to be a form Yoda-speak,

[issue10573] Consistency in unittest assert methods: order of actual, expected

2010-12-15 Thread Ezio Melotti
Changes by Ezio Melotti : -- assignee: michael.foord -> ezio.melotti nosy: +ezio.melotti stage: -> needs patch ___ Python tracker ___ ___

[issue10573] Consistency in unittest assert methods: order of actual, expected

2010-11-28 Thread Michael Foord
New submission from Michael Foord : The unittest documentation, argument names and implementation need to be consistent about the order of (actual, expected) for TestCase.assert methods that take two arguments. This is particularly relevant for the methods that produce 'diffed' output on fai