For some jobs, it can be relevant to use multiple Python versions, such as:
- Test jobs: `py-unittest`, `py-pytest`, `py-nosetest`
-`py-publish` jobs (especially if you're not generating a pure Python package)
This setup is done by defining the PYTHON_IMAGE variable with a parallel/matrix strategy in your .gitlab-ci.yml.
For example, to run py-test jobs using both python:3.13-slim and python:3.12-alpine:
```yaml
py-pytest:
parallel:
matrix:
-PYTHON_IMAGE:python:3.13-slim
-PYTHON_IMAGE:python:3.12-alpine
```
If your tests cannot be executed concurrently due to shared resources (e.g. database access), you can use the `resource_group` feature to limit parallel execution: