<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 17/08/2010 16:53, Alfredo Deza wrote:
<blockquote
 cite="mid:AANLkTikQHZiiT9Bc6AA8Pf8mRZ0e2nfZsyZKskZQ2wGF@mail.gmail.com"
 type="cite"><br>
  <br>
  <div class="gmail_quote">On Tue, Aug 17, 2010 at 5:43 AM, Michael
Foord <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div bgcolor="#ffffff" text="#000000">
    <div class="im">On 16/08/2010 02:21, Ned Batchelder wrote:
    <blockquote type="cite"> I had to bridge this gap for coverage.py,
and ended up doing it for a
few methods, see <a moz-do-not-send="true"
 href="http://bitbucket.org/ned/coveragepy/src/tip/test/backunittest.py"
 target="_blank">http://bitbucket.org/ned/coveragepy/src/tip/test/backunittest.py</a><br>
      <br>
But this method bothers me: the Multiline aspect has nothing to do with
the comparison, only with the reporting of failed assertions.&nbsp; Better
would be to have assertEqual be smart enough to recognize that the
arguments are multiline strings, and just do the right thing with them.<br>
      <br>
    </blockquote>
    <br>
    </div>
If you use unittest2 then you get assertMultilineEqual and smarter
assertEqual behaviour.<br>
    <br>
    </div>
  </blockquote>
  <div>If unittest2 is meant for Python versions older than 2.7, how do
you go around specifying that in a package? I usually have a:</div>
  <div><br>
  </div>
  <div>tests_require = ['nose', 'webtest']</div>
  <div><br>
  </div>
  <div>Or similar packages (e.g. pytest)</div>
  </div>
</blockquote>
<br>
unittest2 works fine with Python 2.7 (and will soon have features that
are in unittest in python 3.2 but not in 2.7).<br>
<br>
Michael Foord<br>
<blockquote
 cite="mid:AANLkTikQHZiiT9Bc6AA8Pf8mRZ0e2nfZsyZKskZQ2wGF@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">
  <div>&nbsp;</div>
  <div>&nbsp;</div>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div bgcolor="#ffffff" text="#000000">Michael
    <div class="im"><br>
    <br>
    <blockquote type="cite">--Ned.<br>
      <br>
On 8/15/2010 8:42 PM, Alfredo Deza wrote:
      <blockquote type="cite">Hi,
        <div><br>
        </div>
        <div>Is there anything like <a moz-do-not-send="true"
 href="http://docs.python.org/library/unittest.html#unittest.TestCase.assertMultiLineEqual"
 target="_blank">assertMultilineEqual</a>
for older versions of Python (e.g. not 2.7)?</div>
        <div><br>
        </div>
        <div>I think nose and pytest may have already solved that, but
is
there an easy way that doesn't require added dependencies?</div>
        <div><br>
        </div>
        <div>Thanks!</div>
        <pre><fieldset></fieldset>
_______________________________________________
testing-in-python mailing list
<a moz-do-not-send="true"
 href="mailto:testing-in-python@lists.idyll.org" target="_blank">testing-in-python@lists.idyll.org</a>
<a moz-do-not-send="true"
 href="http://lists.idyll.org/listinfo/testing-in-python"
 target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a>
  </pre>
      </blockquote>
      <pre><fieldset></fieldset>
_______________________________________________
testing-in-python mailing list
<a moz-do-not-send="true"
 href="mailto:testing-in-python@lists.idyll.org" target="_blank">testing-in-python@lists.idyll.org</a>
<a moz-do-not-send="true"
 href="http://lists.idyll.org/listinfo/testing-in-python"
 target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a>
  </pre>
    </blockquote>
    <br>
    <br>
    </div>
    <font color="#888888">
    <pre cols="72">-- 
<a moz-do-not-send="true" href="http://www.ironpythoninaction.com/"
 target="_blank">http://www.ironpythoninaction.com/</a></pre>
    </font></div>
  </blockquote>
  </div>
  <br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.ironpythoninaction.com/">http://www.ironpythoninaction.com/</a></pre>
</body>
</html>