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:
parent
ba568a137e
commit
0e933ea00b
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user