Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3dad0b8

Browse files
Testgres is tested on python 3.7 now, too (#280)
The problem was in pluggy.Result.In the python 3.7 this thing has the name pluggy._result._ResultCI now tests python 3.7, too.The exact latest version of python 3.7 is v3.7.17.
1 parentbbbec3e commit3dad0b8

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

‎.travis.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ notifications:
1919
on_failure:always
2020

2121
env:
22+
-TEST_PLATFORM=std2-all PYTHON_VERSION=3.7 PG_VERSION=17
2223
-TEST_PLATFORM=std2-all PYTHON_VERSION=3.8.0 PG_VERSION=17
2324
-TEST_PLATFORM=std2-all PYTHON_VERSION=3.8 PG_VERSION=17
2425
-TEST_PLATFORM=std2-all PYTHON_VERSION=3.9 PG_VERSION=17

‎Dockerfile--std2-all.tmpl‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ RUN apk add openssl openssl-dev
2020
RUN apk add sqlite-dev
2121
RUN apk add bzip2-dev
2222

23+
# --------------------------------------------- base3_with_python-3.7
24+
FROM base2_with_python-3 as base3_with_python-3.7
25+
ENV PYTHON_VERSION=3.7
26+
2327
# --------------------------------------------- base3_with_python-3.8.0
2428
FROM base2_with_python-3 as base3_with_python-3.8.0
2529
ENV PYTHON_VERSION=3.8.0

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#testgres
88

9-
PostgreSQL testing utility. Python 3.8+ is supported.
9+
PostgreSQL testing utility. Python 3.7.17+ is supported.
1010

1111

1212
##Installation

‎tests/conftest.py‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,20 @@
1414
import_pytest.unittest
1515
import_pytest.logging
1616

17+
frompackaging.versionimportVersion
18+
1719
# /////////////////////////////////////////////////////////////////////////////
1820

1921
C_ROOT_DIR__RELATIVE=".."
2022

23+
# /////////////////////////////////////////////////////////////////////////////
24+
# T_PLUGGY_RESULT
25+
26+
ifVersion(pluggy.__version__)<=Version("1.2"):
27+
T_PLUGGY_RESULT=pluggy._result._Result
28+
else:
29+
T_PLUGGY_RESULT=pluggy.Result
30+
2131
# /////////////////////////////////////////////////////////////////////////////
2232
# TestConfigPropNames
2333

@@ -344,15 +354,15 @@ def helper__build_test_id(item: pytest.Function) -> str:
344354

345355

346356
defhelper__makereport__setup(
347-
item:pytest.Function,call:pytest.CallInfo,outcome:pluggy.Result
357+
item:pytest.Function,call:pytest.CallInfo,outcome:T_PLUGGY_RESULT
348358
):
349359
assertitemisnotNone
350360
assertcallisnotNone
351361
assertoutcomeisnotNone
352362
# it may be pytest.Function or _pytest.unittest.TestCaseFunction
353363
assertisinstance(item,pytest.Function)
354364
asserttype(call)==pytest.CallInfo# noqa: E721
355-
asserttype(outcome)==pluggy.Result# noqa: E721
365+
asserttype(outcome)==T_PLUGGY_RESULT# noqa: E721
356366

357367
C_LINE1="******************************************************"
358368

@@ -403,15 +413,15 @@ def helper__makereport__setup(
403413

404414
# ------------------------------------------------------------------------
405415
defhelper__makereport__call(
406-
item:pytest.Function,call:pytest.CallInfo,outcome:pluggy.Result
416+
item:pytest.Function,call:pytest.CallInfo,outcome:T_PLUGGY_RESULT
407417
):
408418
assertitemisnotNone
409419
assertcallisnotNone
410420
assertoutcomeisnotNone
411421
# it may be pytest.Function or _pytest.unittest.TestCaseFunction
412422
assertisinstance(item,pytest.Function)
413423
asserttype(call)==pytest.CallInfo# noqa: E721
414-
asserttype(outcome)==pluggy.Result# noqa: E721
424+
asserttype(outcome)==T_PLUGGY_RESULT# noqa: E721
415425

416426
# --------
417427
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):
578588
assertisinstance(item,pytest.Function)
579589
asserttype(call)==pytest.CallInfo# noqa: E721
580590

581-
outcome:pluggy.Result=yield
591+
outcome=yield
582592
assertoutcomeisnotNone
583-
asserttype(outcome)==pluggy.Result# noqa: E721
593+
asserttype(outcome)==T_PLUGGY_RESULT# noqa: E721
584594

585595
asserttype(call.when)==str# noqa: E721
586596

@@ -738,10 +748,10 @@ def pytest_pyfunc_call(pyfuncitem: pytest.Function):
738748
assertlogWrapper._critical_counter==0
739749
assertlogging.root.handleislogWrapper
740750

741-
r:pluggy.Result=yield
751+
r=yield
742752

743753
assertrisnotNone
744-
asserttype(r)==pluggy.Result# noqa: E721
754+
asserttype(r)==T_PLUGGY_RESULT# noqa: E721
745755

746756
assertlogWrapper._old_methodisnotNone
747757
asserttype(logWrapper._err_counter)==int# noqa: E721

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp