From 3c2662580a1b9127ae4c31d666d2fd0314e2a785 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 15 May 2011 11:15:20 +0200 Subject: Cleanup after pull from https://bitbucket.org/timmartin/sphinx --- tests/util.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tests/util.py') diff --git a/tests/util.py b/tests/util.py index f15481e7b..bd50bec05 100644 --- a/tests/util.py +++ b/tests/util.py @@ -193,10 +193,8 @@ def with_app(*args, **kwargs): def gen_with_app(*args, **kwargs): """ - Make a TestApp with args and kwargs, pass it to the test and clean up - properly. The wrapped function is assumed to be a generator and the - wrapper function is itself a generator that will iterate over the - values of the wrapped function and yield them. + Decorate a test generator to pass a TestApp as the first argument to the + test generator when it's executed. """ def generator(func): @wraps(func) @@ -226,7 +224,7 @@ def write_file(name, contents, encoding=None): contents = contents.encode('ascii') else: mode = 'w' - f = open(str(name), 'wb', encoding=encoding) + f = open(str(name), mode, encoding=encoding) f.write(contents) f.close() -- cgit v1.2.1