[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1299956 - /subversion/trunk/subversion/tests/cmdline/svntest/wc.py

From: Greg Stein <gstein_at_gmail.com>
Date: Tue, 13 Mar 2012 02:00:58 -0400

On Mon, Mar 12, 2012 at 22:21, <hwright_at_apache.org> wrote:
>...
> +++ subversion/trunk/subversion/tests/cmdline/svntest/wc.py Tue Mar 13 02:21:36 2012
> @@ -29,6 +29,7 @@ import re
>  import urllib
>  import logging
>  import pprint
> +import cStringIO as StringIO
>...
> +  o = StringIO()

I don't see how a func-call to a module can possibly work, so I'm
assuming this code was not actually tested (last minute change?). That
may also lead to my query about pprint-to-stream vs pformat.

And, FWIW, the cStringIO module is standard in Python 2.5, so there
isn't really a need to import "as StringIO" (as you'd see in various
compat-style import logic).

>...

Cheers,
-g

> +  o.write("=============================================================\n")
> +  o.write("Expected '%s' and actual '%s' in %s tree are different!\n"
> +                % (expected.name, actual.name, label))
> +  o.write("=============================================================\n")
> +  o.write("EXPECTED NODE TO BE:\n")
> +  o.write("=============================================================\n")
> +  expected.pprint(o)
> +  o.write("=============================================================\n")
> +  o.write("ACTUAL NODE FOUND:\n")
> +  o.write("=============================================================\n")
> +  actual.pprint(o)
> +
> +  logger.warn(o.getValue())
> +  o.close()
>
>  ### yanked from tree.py
>  def default_singleton_handler(description, path, item):
>   node = item_to_node(path, item)
>   logger.warn("Couldn't find node '%s' in %s tree" % (node.name, description))
> -  logger.warn(pprint.pformat(node))
> +  o = StringIO()
> +  node.pprint(o)
> +  logger.warn(o.getValue())
> +  o.close()
>   raise svntest.tree.SVNTreeUnequal
>
>
Received on 2012-03-13 07:01:32 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.