diff options
author | W. Trevor King <wking@drexel.edu> | 2009-07-16 05:50:31 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-07-16 05:50:31 -0400 |
commit | dfb7878b674e8eed1cfa55928d5464dc6fb0f085 (patch) | |
tree | 7544d8433e20167c184bffda64dd8e3455e96d53 /becommands/depend.py | |
parent | b39f68dcb0ecdc5f2c3f12fe75b47ff1f4d51e86 (diff) | |
download | bugseverywhere-dfb7878b674e8eed1cfa55928d5464dc6fb0f085.tar.gz |
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.
Diffstat (limited to 'becommands/depend.py')
-rw-r--r-- | becommands/depend.py | 13 |
1 files changed, 7 insertions, 6 deletions
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]) |