Daniel Shahaf wrote on Tue, Jan 25, 2022 at 11:31:22 +0000:
> The problem?  run_svn()'s first parameter is a boolean.  Passing an
> expected error message or wc_dir to it doesn't have the expected
> results.  Most of the above uses are buggy or misleading.
> 
> We should audit uses of run_svn() and related functions.

And afterwards, perhaps something like this:

[[[
Index: subversion/tests/cmdline/svntest/main.py
===================================================================
--- subversion/tests/cmdline/svntest/main.py    (revision 1897453)
+++ subversion/tests/cmdline/svntest/main.py    (working copy)
@@ -668,6 +668,9 @@ def run_command_stdin(command, error_expected, buf
       brief_command = ' '.join(((command,) + varargs)[:4]) + ' ...'
     raise Failure('Command failed: "' + brief_command +
                   '"; exit code ' + str(exit_code))
+  if error_expected and (not stderr_lines) and exit_code == 0:
+    raise Failure('Command unexpectedly succeeded: ' +
+                  repr(brief_command) + '; exit code ' + str(exit_code))
 
   return exit_code, \
          filter_dbg(stdout_lines, binary_mode), \
]]]

Or perhaps assert that ERROR_EXPECTED is one of None/True/False.

Reply via email to