./tools/ci/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 and not flakey' --color yes
+ CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_ENVIRONMENT_PASS_LINUX: LIBPQ_VERSION OPENSSL_VERSION
CIBW_ENVIRONMENT: >-
PSYCOPG_IMPL=binary
LD_LIBRARY_PATH="$LIBPQ_BUILD_PREFIX/lib:$LIBPQ_BUILD_PREFIX/lib64"
PSYCOPG_TEST_WANT_LIBPQ_BUILD=${{ env.LIBPQ_VERSION }}
PSYCOPG_TEST_WANT_LIBPQ_IMPORT=${{ env.LIBPQ_VERSION }}
+ PYTEST_ADDOPTS="-m 'not slow and not flakey' --color yes"
- uses: actions/upload-artifact@v4
with:
MACOSX_ARCHITECTURE: ${{matrix.arch}}
CIBW_BEFORE_ALL_MACOS: ./tools/ci/wheel_macos_before_all.sh
CIBW_TEST_REQUIRES: ./psycopg[test] ./psycopg_pool
- CIBW_TEST_COMMAND: >-
- pytest {project}/tests -m 'not slow and not flakey' --color yes
+ CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_ENVIRONMENT: >-
PG_VERSION=18
PSYCOPG_IMPL=binary
PATH="$LIBPQ_BUILD_PREFIX/bin:$PATH"
PSYCOPG_TEST_WANT_LIBPQ_BUILD=">= ${{env.LIBPQ_VERSION}}"
PSYCOPG_TEST_WANT_LIBPQ_IMPORT=">= ${{env.LIBPQ_VERSION}}"
+ PYTEST_ADDOPTS="-m 'not slow and not flakey and not proxy' --color yes"
- name: Upload artifacts
uses: actions/upload-artifact@v4
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 and not flakey" --color yes
+ CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_ENVIRONMENT_WINDOWS: >-
PSYCOPG_IMPL=binary
PSYCOPG_TEST_DSN="host=127.0.0.1 user=postgres"
PSYCOPG_TEST_WANT_LIBPQ_BUILD=">= 16"
PSYCOPG_TEST_WANT_LIBPQ_IMPORT=">= 16"
+ PYTEST_ADDOPTS="-m 'not slow and not flakey and not proxy' --color yes"
- uses: actions/upload-artifact@v4
with:
import socket
import logging
import subprocess as sp
+from pathlib import Path
from contextlib import contextmanager
import pytest
def proxy(dsn):
"""Return a proxy to the --test-dsn database"""
p = Proxy(dsn)
- yield p
- p.stop()
+ try:
+ yield p
+ finally:
+ p.stop()
class Proxy:
return
logging.info("starting proxy")
- cmdline = [sys.executable, "-m", "tests.pproxy_fix", "--reuse"]
+ pproxy_fix = str(Path(__file__).parent.parent / "tools/pproxy_fix.py")
+ cmdline = [sys.executable, pproxy_fix, "--reuse"]
cmdline += ["-l", f"tunnel://:{self.client_port}"]
cmdline += ["-r", f"tunnel://{self.server_host}:{self.server_port}"]
break
time.sleep(0.1)
else:
- raise ValueError("the proxy didn't start listening in time")
+ # final shot at connecting, which will raise an exception
+ try:
+ sock.connect((self.client_host, self.client_port))
+ except Exception as ex:
+ pytest.fail(f"the proxy didn't start listening in time: {ex}")
logging.info("proxy listening")