# MacOS on GitHub Actions seems particularly slow.
# Don't run timing-based tests as they regularly fail.
# pproxy-based tests fail too, with the proxy not coming up in 2s.
- PYTEST_ADDOPTS: -m 'not timing and not proxy' --color yes
+ PYTEST_ADDOPTS: -m 'not timing and not proxy and not mypy' --color yes
steps:
- uses: actions/checkout@v2
PSYCOPG_IMPL: ${{ matrix.impl }}
PSYCOPG_TEST_DSN: "host=127.0.0.1 dbname=postgres"
# On windows pproxy doesn't seem very happy. Also a few timing test fail.
- PYTEST_ADDOPTS: -m 'not timing and not proxy' --color yes
+ PYTEST_ADDOPTS: -m 'not timing and not proxy and not mypy' --color yes
steps:
- uses: actions/checkout@v2
import pytest
+def pytest_configure(config):
+ config.addinivalue_line(
+ "markers",
+ "mypy: the test uses mypy (the marker is set automatically"
+ " on tests using the fixture)",
+ )
+
+
def pytest_collection_modifyitems(items):
- # All the tests using mypy are slow
for item in items:
if "mypy" in item.fixturenames:
+ # add a mypy tag so we can address these tests only
+ item.add_marker(pytest.mark.mypy)
+
+ # All the tests using mypy are slow
item.add_marker(pytest.mark.slow)