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 all commits
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
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
26 changes: 18 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -344,15 +354,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 +413,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 +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

Expand Down Expand Up @@ -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
Expand Down