You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
i started to use tap and for my testing scenarios i need to pretty print queries before and after i run a function. But when i raise a notice it is not printed together with the test output, but before.
I thought maybe this could be a valuable feature for using pgTap.
I was thinking about something like:
create function schema.pretty_print_sql() returns setof text as $$ begin return next diag_query('select a as "fieldA", b from tables where conditions', 'Explanation'); return next is(1, 1, 'test explanation); end; $$ language plpgsql;
Up to now I have only few columns per test case which are affected by the tests and displayed as before/after. I use it already with raise notice and one small function. But the test cases and the test results are not at the same place.
Hello,
i started to use tap and for my testing scenarios i need to pretty print queries before and after i run a function. But when i raise a notice it is not printed together with the test output, but before.
I thought maybe this could be a valuable feature for using pgTap.
I was thinking about something like:
create function schema.pretty_print_sql() returns setof text as $$
begin
return next diag_query('select a as "fieldA", b from tables where conditions', 'Explanation');
return next is(1, 1, 'test explanation);
end;
$$ language plpgsql;
and with
runtests('schema'::name);
should yield something like
ok 1 - schema.pretty_print_sql
1..1
Best Florian
The text was updated successfully, but these errors were encountered: