From dfb7878b674e8eed1cfa55928d5464dc6fb0f085 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 16 Jul 2009 05:50:31 -0400 Subject: Renamed test->manipulate_encodings in becommands.*.execute. Reminder from my initial libbe/encoding.py commit: Because of the stdout replacement, the doctests executes now need an optional 'test' argument to turn off replacement during the doctests, otherwise doctest flips out (since it had set up stdout to catch output, and then we clobbered it's setup). I'm also trying to catch stdout/stderr from be-handle-mail, and I ran into the same problem. It took me a bit to remember exactly what "test" was supposed to do, so I thought I'd make the argument name more specific. If you need other changes when running in "test" mode, you'll have to add other kwargs. --- becommands/depend.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'becommands/depend.py') diff --git a/becommands/depend.py b/becommands/depend.py index 48e1527..977edae 100644 --- a/becommands/depend.py +++ b/becommands/depend.py @@ -18,22 +18,22 @@ from libbe import cmdutil, bugdir import os, copy __desc__ = __doc__ -def execute(args, test=False): +def execute(args, manipulate_encodings=True): """ >>> from libbe import utility >>> bd = bugdir.simple_bug_dir() >>> bd.save() >>> os.chdir(bd.root) - >>> execute(["a", "b"], test=True) + >>> execute(["a", "b"], manipulate_encodings=False) Blocks on a: b - >>> execute(["a"], test=True) + >>> execute(["a"], manipulate_encodings=False) Blocks on a: b - >>> execute(["--show-status", "a"], test=True) # doctest: +NORMALIZE_WHITESPACE + >>> execute(["--show-status", "a"], manipulate_encodings=False) # doctest: +NORMALIZE_WHITESPACE Blocks on a: b closed - >>> execute(["-r", "a", "b"], test=True) + >>> execute(["-r", "a", "b"], manipulate_encodings=False) """ parser = get_parser() options, args = parser.parse_args(args) @@ -47,7 +47,8 @@ def execute(args, test=False): help() raise cmdutil.UsageError("Too many arguments.") - bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test) + bd = bugdir.BugDir(from_disk=True, + manipulate_encodings=manipulate_encodings) bugA = bd.bug_from_shortname(args[0]) if len(args) == 2: bugB = bd.bug_from_shortname(args[1]) -- cgit