The proxy doesn't start in time 2s seem plenty.
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
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"""