[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-11-21 Thread R. David Murray
R. David Murray added the comment: Agreed on the closing. The pre-diff processing function would be a great addition. For the record, I am currently satisfying my use case by doing this: self.assertEqual(bstr1.split(b'\n'), bstr2.split(b'\n')) which produces a very readable diff. --

[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-11-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Rejecting this one for reasons we discussed earlier. The assertEqual() method needs to be the primary interface. Everything else is starting to mix content and presentation (i.e. passing in separators). The existing repr() works fine with bytes and Mich

[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-10-31 Thread Michael Foord
Michael Foord added the comment: David - would you get a good approximation of what you want simply with: self.assertEqual(ascii(first), ascii(second)) (This actually returns "b'first'" "b'second'" so you may want a convenience function that chops the leading and trailing b'/') As ascii

[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-10-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Am discussing this with the OP on IRC and tabling it for a while so we can better think out the API. The goal is to let assertEqual(a, b) do straight-comparions of raw bytes, but to give a nice looking diff (possibly translated with line breaks or somesuch

[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-10-30 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger priority: normal -> low ___ Python tracker ___ ___ Python

[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-10-23 Thread R. David Murray
R. David Murray added the comment: My best guess currently is that the failing test is a bug in difflib, but I haven't dug into that code yet to prove it. It's still possible it's something stupid in my code, but as far as I can see there's no character over where that - is in the difflib ou

[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-10-22 Thread R. David Murray
Changes by R. David Murray : -- title: Add an assertBytesMultiLineEqual to unittest and use it for bytes assertEqual -> Add an assertBytesEqual to unittest and use it for bytes assertEqual ___ Python tracker