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

39 lines
766 B
Python
Raw Permalink Normal View History

#coding:utf-8
2022-01-27 20:08:36 +01:00
"""
ID: issue-7064
ISSUE: 7064
TITLE: Linear regression functions aren't implemented correctly
DESCRIPTION:
FBTEST: bugs.gh_7064
2022-01-27 20:08:36 +01:00
"""
2022-01-27 20:08:36 +01:00
import pytest
from firebird.qa import *
2022-01-27 20:08:36 +01:00
db = db_factory()
2022-01-27 20:08:36 +01:00
test_script = """
set heading off;
select regr_avgx(a, b)
from (
select 1, 1 from RDB$DATABASE union all
select 2, 1 from RDB$DATABASE union all
select 3, 2 from RDB$DATABASE union all
select 4, 2 from RDB$DATABASE
) t (a, b);
"""
2022-01-27 20:08:36 +01:00
act = isql_act('db', test_script)
2022-01-27 20:08:36 +01:00
expected_stdout = """
1.500000000000000
"""
@pytest.mark.version('>=4.0.1')
2022-01-27 20:08:36 +01:00
def test_1(act: Action):
act.expected_stdout = expected_stdout
act.execute()
assert act.clean_stdout == act.clean_expected_stdout