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/severity.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'becommands/severity.py') diff --git a/becommands/severity.py b/becommands/severity.py index fde9fba..4e95638 100644 --- a/becommands/severity.py +++ b/becommands/severity.py @@ -20,17 +20,17 @@ from libbe import cmdutil, bugdir, bug __desc__ = __doc__ -def execute(args, test=False): +def execute(args, manipulate_encodings=True): """ >>> import os >>> bd = bugdir.simple_bug_dir() >>> os.chdir(bd.root) - >>> execute(["a"], test=True) + >>> execute(["a"], manipulate_encodings=False) minor - >>> execute(["a", "wishlist"], test=True) - >>> execute(["a"], test=True) + >>> execute(["a", "wishlist"], manipulate_encodings=False) + >>> execute(["a"], manipulate_encodings=False) wishlist - >>> execute(["a", "none"], test=True) + >>> execute(["a", "none"], manipulate_encodings=False) Traceback (most recent call last): UserError: Invalid severity level: none """ @@ -39,7 +39,8 @@ def execute(args, test=False): complete(options, args, parser) if len(args) not in (1,2): raise cmdutil.UsageError - bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test) + bd = bugdir.BugDir(from_disk=True, + manipulate_encodings=manipulate_encodings) bug = bd.bug_from_shortname(args[0]) if len(args) == 1: print bug.severity -- cgit