diff options
author | Darik Gamble <darik.gamble.spam@gmail.com> | 2015-10-21 17:10:30 -0400 |
---|---|---|
committer | Darik Gamble <darik.gamble@gmail.com> | 2015-10-28 10:58:25 -0400 |
commit | c9b55ba12e2a87cb6b15bd9a009342aece9c3a18 (patch) | |
tree | 61024289a9fbdb32c430995b16b064132b260c1c /tests/utils.py | |
parent | 258c08dfa121d1246bc6b6dd79fbe2870c42c853 (diff) |
Fix pgexecute tests
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/utils.py b/tests/utils.py index 93e9f258..d7d5993d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -58,12 +58,17 @@ def drop_tables(conn): DROP SCHEMA IF EXISTS schema2 CASCADE''') -def run(executor, sql, join=False, expanded=False, pgspecial=None): +def run(executor, sql, join=False, expanded=False, pgspecial=None, + exception_formatter=None): " Return string output for the sql to be run " - result = [] - for title, rows, headers, status in executor.run(sql, pgspecial): - result.extend(format_output(title, rows, headers, status, 'psql', - expanded=expanded)) + + results = executor.run(sql, pgspecial, exception_formatter) + formatted = [] + + for title, rows, headers, status in results: + formatted.extend(format_output(title, rows, headers, status, 'psql', + expanded=expanded)) if join: - result = '\n'.join(result) - return result + formatted = '\n'.join(formatted) + + return formatted |