Showing content from http://mail.python.org/pipermail/python-dev/attachments/20101220/daeed91d/attachment.html below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body text="#330033" bgcolor="#ffffff">
On 12/20/2010 6:31 AM, Antoine Pitrou wrote:
<blockquote
cite="mid:1292855497.3737.55.camel@localhost.localdomain"
type="cite">
<blockquote type="cite" style="color: rgb(0, 0, 0);">
<pre wrap=""><span class="moz-txt-citetags">> </span>Diffing is completely an implementation detail of how the failure
<span class="moz-txt-citetags">> </span>messages are generated. The important thing is that failure messages
<span class="moz-txt-citetags">> </span>make sense with respect to actual result and expected result.
</pre>
</blockquote>
<pre wrap="">Which, again, they don't. Let's see:
self.assertEqual(actual, expected)
AssertionError: 'a\nb\nc\ne\n' != 'a\nb\nc\nd\n'
a
b
c
- e
+ d
The diff shows "expected - actual", but it would be logical (in your own
logic) to display "actual - expected". The whole issue disappears if you
drop this idea of naming the arguments "actual" and "expected".
</pre>
</blockquote>
<br>
I'm not a unittest user, although I probably will become one, in
time, when I learn enough to contribute to Python, instead of just
find bugs in it from use.<br>
<br>
I don't much care what the parameters names are, although the terms
actual and expected seem good for testing scenarios if properly
used, but the above does not match what I would expect the behavior
to be from a testing scenario: run the test, and tell me what
changed from the expected results.<br>
<br>
If the expected result (not parameter) is d and the actual result
(not parameter) is e, the diff should show<br>
<br>
 a<br>
 b<br>
 c<br>
- d<br>
+ e<br>
<br>
Thinking-that-sometimes-a-novice's-expectations-are-relevant-to-such-discussions'ly
yours,<br>
Glenn<br>
<br>
<br>
<br>
</body>
</html>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4