Skip to content

Testgres is tested on python 3.7 now, too #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
A support of python 3.7.17 is added
The problem was in pluggy.Result.

In the python 3.7 this thing has the name pluggy._result._Result

CI now tests python 3.7, too.

The exact latest version of python 3.7 is v3.7.17.
  • Loading branch information
dmitry-lipetsk committed Jul 7, 2025
commit 6b448500b3724867206863cba6dabf24a61a009c
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile--std2-all.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# testgres

PostgreSQL testing utility. Python 3.8+ is supported.
PostgreSQL testing utility. Python 3.7.17+ is supported.


## Installation
Expand Down
24 changes: 16 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pluggy
import pytest
import os
import sys
import logging
import pathlib
import math
Expand All @@ -16,6 +17,13 @@

# /////////////////////////////////////////////////////////////////////////////

if sys.version_info < (3, 8):
T_PLUGGY_RESULT = pluggy._result._Result
else:
T_PLUGGY_RESULT = pluggy.Result

# /////////////////////////////////////////////////////////////////////////////

C_ROOT_DIR__RELATIVE = ".."

# /////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -344,15 +352,15 @@ 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
assert outcome is not None
# 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 = "******************************************************"

Expand Down Expand Up @@ -403,15 +411,15 @@ 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
assert outcome is not None
# 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)
Expand Down Expand Up @@ -578,9 +586,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

Expand Down Expand Up @@ -738,10 +746,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
Expand Down