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

2011-01-28 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk 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-28 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Code patch looks good to me. Unittest tests pass. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10573 ___

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

2011-01-28 Thread Michael Foord
Changes by Michael Foord mich...@voidspace.org.uk: -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10573

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

2011-01-23 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk 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

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

2011-01-23 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk 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

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

2011-01-20 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com 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. --

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

2010-12-26 Thread Ron Adam
Ron Adam ron_a...@users.sourceforge.net 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 rep...@bugs.python.org

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

2010-12-18 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com 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

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

2010-12-18 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: If Michael and Raymond reach a consensus, this can go in before beta2. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10573

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

2010-12-18 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

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

2010-12-18 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk 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 Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com 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-16 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

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

2010-12-15 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- assignee: michael.foord - ezio.melotti nosy: +ezio.melotti stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10573 ___

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

2010-11-28 Thread Michael Foord
New submission from Michael Foord mich...@voidspace.org.uk: 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