From 3de5c4145d6d6f79eabe906100171ed75cb78acb Mon Sep 17 00:00:00 2001 From: pavel-zotov Date: Tue, 12 Dec 2023 20:36:50 +0300 Subject: [PATCH] Added/Updated tests\bugs\core_4440_test.py: Added 'Error reading/writing' in substitutions: messages caused by crash must not be suppressed. Added 'combine_output = True' in order to see SQLSTATE if any error occurs. --- tests/bugs/core_4440_test.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/bugs/core_4440_test.py b/tests/bugs/core_4440_test.py index b6977842..ea8a80a4 100644 --- a/tests/bugs/core_4440_test.py +++ b/tests/bugs/core_4440_test.py @@ -3,10 +3,15 @@ """ ID: issue-4760 ISSUE: 4760 -TITLE: isql crash without connect when execute command "show version" +TITLE: ISQL crashed without connect when execute command "show version" DESCRIPTION: JIRA: CORE-4440 FBTEST: bugs.core_4440 +NOTES: + [12.12.2023] pzotov + Added 'Error reading/writing' in substitutions: runtime error must not be filtered out by '?!(...)' pattern + ("negative lookahead assertion", see https://docs.python.org/3/library/re.html#regular-expression-syntax). + Added 'combine_output = True' in order to see message related to any error. """ import pytest @@ -17,18 +22,16 @@ db = db_factory() test_script = """ show version; set list on; - select current_user from rdb$database; + select current_user as whoami from rdb$database; """ -act = isql_act('db', test_script, substitutions=[('^((?!SYSDBA).)*$', '')]) - -expected_stdout = """ - USER SYSDBA -""" +act = isql_act('db', test_script, substitutions = [ ('[ \t]+', ' '), ('^((?!SQLSTATE|(Error\\s+(reading|writing))|WHOAMI).)*$', '') ] ) @pytest.mark.version('>=3.0') def test_1(act: Action): + expected_stdout = f""" + WHOAMI {act.db.user.upper()} + """ act.expected_stdout = expected_stdout - act.execute() + act.execute(combine_output = True) assert act.clean_stdout == act.clean_expected_stdout -