6
0
mirror of https://github.com/FirebirdSQL/firebird-qa.git synced 2025-01-22 13:33:07 +01:00

Engine version should be compared with tested value via Action.is_version() rather than excessive connect to services and obtaining it from srv.info. Changed code after suggestion by pcisar.

This commit is contained in:
zotov 2022-04-08 14:16:01 +03:00
parent ba568a137e
commit 0e933ea00b
10 changed files with 10 additions and 41 deletions

View File

@ -39,10 +39,7 @@ fb5x_checked_stdout = """
@pytest.mark.version('>=3.0')
def test_1(act: Action):
with act.connect_server() as srv:
engine_major = int(srv.info.engine_version)
act.expected_stdout = fb3x_checked_stdout if engine_major < 5 else fb5x_checked_stdout
act.expected_stdout = fb3x_checked_stdout if act.is_version('<5') else fb5x_checked_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout

View File

@ -41,9 +41,6 @@ fb5x_checked_stdout = """
@pytest.mark.version('>=3.0')
def test_1(act: Action):
with act.connect_server() as srv:
engine_major = int(srv.info.engine_version)
act.expected_stdout = fb3x_checked_stdout if engine_major < 5 else fb5x_checked_stdout
act.expected_stdout = fb3x_checked_stdout if act.is_version('<5') else fb5x_checked_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout

View File

@ -76,10 +76,7 @@ fb5x_checked_stdout = """
@pytest.mark.version('>=3.0.3')
def test_1(act: Action):
with act.connect_server() as srv:
engine_major = int(srv.info.engine_version)
act.expected_stdout = fb3x_checked_stdout if engine_major < 5 else fb5x_checked_stdout
act.expected_stdout = fb3x_checked_stdout if act.is_version('<5') else fb5x_checked_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout

View File

@ -127,10 +127,7 @@ fb5x_checked_stdout = """
@pytest.mark.version('>=3.0')
def test_1(act: Action):
with act.connect_server() as srv:
engine_major = int(srv.info.engine_version)
act.expected_stdout = fb3x_checked_stdout if engine_major < 5 else fb5x_checked_stdout
act.expected_stdout = fb3x_checked_stdout if act.is_version('<5') else fb5x_checked_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout

View File

@ -203,11 +203,7 @@ fb5x_checked_stdout = """
@pytest.mark.version('>=3.0')
def test_1(act: Action):
with act.connect_server() as srv:
engine_major = int(srv.info.engine_version)
act.expected_stdout = fb3x_checked_stdout if engine_major < 5 else fb5x_checked_stdout
act.expected_stdout = fb3x_checked_stdout if act.is_version('<5') else fb5x_checked_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout

View File

@ -60,11 +60,8 @@ def test_1(act: Action):
c = con.cursor()
c.execute(f"insert into test(id, s) select row_number()over(), lpad('', 8191, 'Алексей, Łukasz, Máté, François, Jørgen, Νικόλαος') from rdb$types,rdb$types rows {MIN_RECS_TO_ADD}")
con.commit()
engine_major = int(con.info.engine_version)
#
#act.expected_stdout = expected_stdout
act.expected_stdout = fb3x_checked_stdout if engine_major < 5 else fb5x_checked_stdout
act.expected_stdout = fb3x_checked_stdout if act.is_version('<5') else fb5x_checked_stdout
act.isql(switches=['-q'], input=test_script)
act.stdout = act.stdout.upper()
assert act.clean_stdout == act.clean_expected_stdout

View File

@ -101,9 +101,6 @@ fb5x_checked_stdout = """
@pytest.mark.version('>=3.0')
def test_1(act: Action):
with act.connect_server() as srv:
engine_major = int(srv.info.engine_version)
act.expected_stdout = fb3x_checked_stdout if engine_major < 5 else fb5x_checked_stdout
act.expected_stdout = fb3x_checked_stdout if act.is_version('<5') else fb5x_checked_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout

View File

@ -107,9 +107,6 @@ fb5x_checked_stdout = """
@pytest.mark.version('>=3.0')
def test_1(act: Action):
with act.connect_server() as srv:
engine_major = int(srv.info.engine_version)
act.expected_stdout = fb3x_checked_stdout if engine_major < 5 else fb5x_checked_stdout
act.expected_stdout = fb3x_checked_stdout if act.is_version('<5') else fb5x_checked_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout

View File

@ -129,9 +129,6 @@ fb5x_checked_stdout = """
@pytest.mark.version('>=3.0')
def test_1(act: Action):
with act.connect_server() as srv:
engine_major = int(srv.info.engine_version)
act.expected_stdout = fb3x_checked_stdout if engine_major < 5 else fb5x_checked_stdout
act.expected_stdout = fb3x_checked_stdout if act.is_version('<5') else fb5x_checked_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout

View File

@ -124,9 +124,6 @@ fb5x_checked_stdout = """
@pytest.mark.version('>=3.0')
def test_1(act: Action):
with act.connect_server() as srv:
engine_major = int(srv.info.engine_version)
act.expected_stdout = fb3x_checked_stdout if engine_major < 5 else fb5x_checked_stdout
act.expected_stdout = fb3x_checked_stdout if act.is_version('<5') else fb5x_checked_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout