From 9a8d2c2d6f5acf6ad37b84ebc59e8a95e294349a Mon Sep 17 00:00:00 2001 From: Joakim Koljonen Date: Mon, 16 Jan 2017 13:27:19 +0900 Subject: Make format_output take a settings object --- tests/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/utils.py') diff --git a/tests/utils.py b/tests/utils.py index 2f17020b..3b73ce31 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,7 +1,7 @@ import pytest import psycopg2 import psycopg2.extras -from pgcli.main import format_output +from pgcli.main import format_output, OutputSettings from pgcli.pgexecute import register_json_typecasters # TODO: should this be somehow be divined from environment? @@ -64,10 +64,10 @@ def run(executor, sql, join=False, expanded=False, pgspecial=None, results = executor.run(sql, pgspecial, exception_formatter) formatted = [] - + settings = OutputSettings(table_format='psql', dcmlfmt='d', floatfmt='g', + expanded=expanded) for title, rows, headers, status, sql, success in results: - formatted.extend(format_output(title, rows, headers, status, 'psql', dcmlfmt='d', floatfmt='g', - expanded=expanded)) + formatted.extend(format_output(title, rows, headers, status, settings)) if join: formatted = '\n'.join(formatted) -- cgit v1.2.3