diff options
author | Karl-Aksel Puulmann <oxymaccy@gmail.com> | 2015-01-08 11:58:02 +0200 |
---|---|---|
committer | Amjith Ramanujam <amjith.r@gmail.com> | 2015-01-09 00:14:18 -0800 |
commit | b7f9c00c21ab3bbcdfccd63a7fd9f844e363270f (patch) | |
tree | ccf4092f73f2a8a633c35565b72b496222a069fa /tests/utils.py | |
parent | 8307a7e642dd58b0ea1633cf0cf2ab690449c592 (diff) |
Fix issues pointed out in pull request comments.
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/utils.py b/tests/utils.py index d83843ba..648ca3d9 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -35,8 +35,11 @@ def drop_tables(conn): cur.execute('''DROP SCHEMA public CASCADE; CREATE SCHEMA public''') -def run(executor, sql): +def run(executor, sql, join=False): " Return string output for the sql to be run " - data = executor.run(sql) - assert len(data) == 1 # current code does that - return format_output(*data[0]) + result = [] + for rows, headers, status in executor.run(sql): + result.extend(format_output(rows, headers, status)) + if join: + result = '\n'.join(result) + return result |