diff --git a/.travis.yml b/.travis.yml index 55b7afa..b762b0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ notifications: on_failure: always env: + - TEST_PLATFORM=std2-all PYTHON_VERSION=3.7 PG_VERSION=17 - TEST_PLATFORM=std2-all PYTHON_VERSION=3.8.0 PG_VERSION=17 - TEST_PLATFORM=std2-all PYTHON_VERSION=3.8 PG_VERSION=17 - TEST_PLATFORM=std2-all PYTHON_VERSION=3.9 PG_VERSION=17 diff --git a/Dockerfile--std2-all.tmpl b/Dockerfile--std2-all.tmpl index 10d8280..6a3d817 100644 --- a/Dockerfile--std2-all.tmpl +++ b/Dockerfile--std2-all.tmpl @@ -20,6 +20,10 @@ RUN apk add openssl openssl-dev RUN apk add sqlite-dev RUN apk add bzip2-dev +# --------------------------------------------- base3_with_python-3.7 +FROM base2_with_python-3 as base3_with_python-3.7 +ENV PYTHON_VERSION=3.7 + # --------------------------------------------- base3_with_python-3.8.0 FROM base2_with_python-3 as base3_with_python-3.8.0 ENV PYTHON_VERSION=3.8.0 diff --git a/README.md b/README.md index defbc8b..af8172f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # testgres -PostgreSQL testing utility. Python 3.8+ is supported. +PostgreSQL testing utility. Python 3.7.17+ is supported. ## Installation diff --git a/tests/conftest.py b/tests/conftest.py index 25580ae..a76f2eb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,10 +14,20 @@ import _pytest.unittest import _pytest.logging +from packaging.version import Version + # ///////////////////////////////////////////////////////////////////////////// C_ROOT_DIR__RELATIVE = ".." +# ///////////////////////////////////////////////////////////////////////////// +# T_PLUGGY_RESULT + +if Version(pluggy.__version__) <= Version("1.2"): + T_PLUGGY_RESULT = pluggy._result._Result +else: + T_PLUGGY_RESULT = pluggy.Result + # ///////////////////////////////////////////////////////////////////////////// # TestConfigPropNames @@ -344,7 +354,7 @@ def helper__build_test_id(item: pytest.Function) -> str: def helper__makereport__setup( - item: pytest.Function, call: pytest.CallInfo, outcome: pluggy.Result + item: pytest.Function, call: pytest.CallInfo, outcome: T_PLUGGY_RESULT ): assert item is not None assert call is not None @@ -352,7 +362,7 @@ def helper__makereport__setup( # it may be pytest.Function or _pytest.unittest.TestCaseFunction assert isinstance(item, pytest.Function) assert type(call) == pytest.CallInfo # noqa: E721 - assert type(outcome) == pluggy.Result # noqa: E721 + assert type(outcome) == T_PLUGGY_RESULT # noqa: E721 C_LINE1 = "******************************************************" @@ -403,7 +413,7 @@ def helper__makereport__setup( # ------------------------------------------------------------------------ def helper__makereport__call( - item: pytest.Function, call: pytest.CallInfo, outcome: pluggy.Result + item: pytest.Function, call: pytest.CallInfo, outcome: T_PLUGGY_RESULT ): assert item is not None assert call is not None @@ -411,7 +421,7 @@ def helper__makereport__call( # it may be pytest.Function or _pytest.unittest.TestCaseFunction assert isinstance(item, pytest.Function) assert type(call) == pytest.CallInfo # noqa: E721 - assert type(outcome) == pluggy.Result # noqa: E721 + assert type(outcome) == T_PLUGGY_RESULT # noqa: E721 # -------- item_error_msg_count1 = item.stash.get(g_error_msg_count_key, 0) @@ -578,9 +588,9 @@ def pytest_runtest_makereport(item: pytest.Function, call: pytest.CallInfo): assert isinstance(item, pytest.Function) assert type(call) == pytest.CallInfo # noqa: E721 - outcome: pluggy.Result = yield + outcome = yield assert outcome is not None - assert type(outcome) == pluggy.Result # noqa: E721 + assert type(outcome) == T_PLUGGY_RESULT # noqa: E721 assert type(call.when) == str # noqa: E721 @@ -738,10 +748,10 @@ def pytest_pyfunc_call(pyfuncitem: pytest.Function): assert logWrapper._critical_counter == 0 assert logging.root.handle is logWrapper - r: pluggy.Result = yield + r = yield assert r is not None - assert type(r) == pluggy.Result # noqa: E721 + assert type(r) == T_PLUGGY_RESULT # noqa: E721 assert logWrapper._old_method is not None assert type(logWrapper._err_counter) == int # noqa: E721