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

Re: problems writing a regression test for issue 4647

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sun, 28 Aug 2016 01:53:06 +0000

Stefan wrote on Sun, Aug 28, 2016 at 00:06:19 +0200:
> START: resolve_tests.py
> W: Unexpected output
> W: EXPECTED STDOUT (unordered):
> W: | Resolved conflicted state of 's'
> W: | Resolved conflicted state of 'v'
> W: | Resolved conflicted state of 'n'
> W: | Resolved conflicted state of '-'
> W: | Resolved conflicted state of 't'
> W: | Resolved conflicted state of 'e'

This is typical of "pass a string where an iterable is expected" errors
in Python:

    % python
>>> def f(x):
    ... for i in x:
    ... print(repr(i))
    ...
>>> f("string")
    's'
    't'
    'r'
    'i'
    'n'
    'g'
>>> f(["string"])
    'string'

The first call iterates the string, the second call iterates the
(anonymous) list.

> Index: subversion/tests/cmdline/resolve_tests.py
> ===================================================================
> --- subversion/tests/cmdline/resolve_tests.py (revision 1743999)
> +++ subversion/tests/cmdline/resolve_tests.py (working copy)
> @@ -598,7 +598,68 @@
> + def do_binary_conflicting_merge():
> + svntest.actions.run_and_verify_svn(None, [],
> + 'revert', '--recursive', A_COPY_path)
> + svntest.main.run_svn(None, 'merge', sbox.repo_url + "/A_COPY/theta", wc_dir + "/A/theta")
> +
> + # Test 'svn resolve -R --accept base'
> + do_binary_conflicting_merge()
> + svntest.actions.run_and_verify_resolve(wc_dir,
> + '-R', '--accept', 'base',
> + A_COPY_path)

This is line 648 which the traceback pointed you to. If you look at the
definition of run_and_verify_resolve() you'll see that the first formal
argument is EXPECTED_PATHS, plural; it should be passed an iterable
whose elements are ("local style") path strings.

In short: you're passing an improper first argument to
run_and_verify_resolve(). I'm guessing you want to pass
«[os.path.abspath(A_COPY_path)]» (again a one-element list).

Cheers,

Daniel
Received on 2016-08-28 03:53:39 CEST

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