pip install -e ./psycopg[test]
- name: Test the sdist package
- run: pytest -m 'not slow' --color yes
+ run: pytest -m 'not slow and not flakey' --color yes
env:
PSYCOPG_IMPL: ${{ matrix.impl }}
PSYCOPG_TEST_DSN: "host=127.0.0.1 user=postgres"
if: ${{ matrix.package == 'psycopg_c' }}
- name: Test the sdist package
- run: pytest -m 'not slow' --color yes
+ run: pytest -m 'not slow and not flakey' --color yes
env:
PSYCOPG_IMPL: ${{ matrix.impl }}
PSYCOPG_TEST_DSN: "host=127.0.0.1 user=postgres"
./tools/build/strip_wheel.sh {wheel}
&& auditwheel repair -w {dest_dir} {wheel}
CIBW_TEST_REQUIRES: ./psycopg[test] ./psycopg_pool
- CIBW_TEST_COMMAND: pytest {project}/tests -m 'not slow' --color yes
+ CIBW_TEST_COMMAND: >-
+ pytest {project}/tests -m 'not slow and not flakey' --color yes
CIBW_ENVIRONMENT: >-
PSYCOPG_IMPL=binary
PSYCOPG_TEST_DSN='host=172.17.0.1 user=postgres'
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_BEFORE_ALL_MACOS: ./tools/build/wheel_macos_before_all.sh
CIBW_TEST_REQUIRES: ./psycopg[test] ./psycopg_pool
- CIBW_TEST_COMMAND: pytest {project}/tests -m 'not slow' --color yes
+ CIBW_TEST_COMMAND: >-
+ pytest {project}/tests -m 'not slow and not flakey' --color yes
CIBW_ENVIRONMENT: >-
PSYCOPG_IMPL=binary
PSYCOPG_TEST_DSN='dbname=postgres'
delvewheel repair -w {dest_dir}
--no-mangle "libiconv-2.dll;libwinpthread-1.dll" {wheel}
CIBW_TEST_REQUIRES: ./psycopg[test] ./psycopg_pool
- CIBW_TEST_COMMAND: pytest {project}/tests -m "not slow" --color yes
+ CIBW_TEST_COMMAND: >-
+ pytest {project}/tests -m "not slow and not flakey" --color yes
CIBW_ENVIRONMENT_WINDOWS: >-
PSYCOPG_IMPL=binary
PATH="C:\\Program Files\\PostgreSQL\\14\\bin;$PATH"
def pytest_configure(config):
markers = [
"slow: this test is kinda slow (skip with -m 'not slow')",
+ "flakey(reason): this test may fail unpredictably')",
# There are troubles on travis with these kind of tests and I cannot
# catch the exception for my life.
"subprocess: the test import psycopg after subprocess",
pytest.mark.pipeline,
]
+pipeline_aborted = pytest.mark.flakey("the server might get in pipeline aborted")
+
def test_repr(conn):
with conn.pipeline() as p:
p.sync()
+@pipeline_aborted
def test_errors_raised_on_commit(conn):
with conn.pipeline():
conn.execute("select 1 from nosuchtable")
from psycopg import pq
from psycopg import errors as e
+from .test_pipeline import pipeline_aborted
+
pytestmark = [
pytest.mark.asyncio,
pytest.mark.libpq(">= 14"),
await p.sync()
+@pipeline_aborted
async def test_errors_raised_on_commit(aconn):
async with aconn.pipeline():
await aconn.execute("select 1 from nosuchtable")