From: Daniele Varrazzo Date: Tue, 29 Jun 2021 00:08:30 +0000 (+0100) Subject: Skip proxy-based tests on MacOS tests X-Git-Tag: 3.0.dev0~6^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f664b71b072ac272b53543436bd25e87b89a50a;p=thirdparty%2Fpsycopg.git Skip proxy-based tests on MacOS tests The proxy doesn't start in time 2s seem plenty. --- diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cae4ff92e..bac134cde 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -123,7 +123,8 @@ jobs: PSYCOPG_TEST_DSN: "host=127.0.0.1 user=runner dbname=postgres" # MacOS on GitHub Actions seems particularly slow. # Don't run timing-based tests as they regularly fail. - PYTEST_ADDOPTS: "-m 'not timing'" + # pproxy-based tests fail too, with the proxy not coming up in 2s. + PYTEST_ADDOPTS: "-m 'not timing and not proxy'" steps: - uses: actions/checkout@v2 diff --git a/tests/fix_proxy.py b/tests/fix_proxy.py index ef87b6397..4128bcb54 100644 --- a/tests/fix_proxy.py +++ b/tests/fix_proxy.py @@ -12,6 +12,20 @@ from psycopg import conninfo logger = logging.getLogger() +def pytest_collection_modifyitems(items): + for item in items: + if "proxy" in item.fixturenames: + item.add_marker(pytest.mark.proxy) + + +def pytest_configure(config): + config.addinivalue_line( + "markers", + "proxy: the test uses pproxy (the marker is set automatically" + " on tests using the fixture)", + ) + + @pytest.fixture def proxy(dsn): """Return a proxy to the --test-dsn database"""