A subset of pytest tests cannot run on gitlab due to dependencies on locally ran services. How can I exclude them from gitlab CI pipelines while keeping them for local testing? I am not sure if the filtering needs to be done in pytest, tox or gitlab config.
Current configuration:
tox.ini [testenv] commands = pytest {posargs}
gitlab-ci.yml build: stage: build script: - tox
The most convenient way of doing that is dynamically through pytest
def test_function(): if not valid_config(): pytest.xfail("unsupported configuration")
https://docs.pytest.org/en/latest/skipping.html
2.1m questions
2.1m answers
60 comments
57.0k users