diff --git a/.gitlab/ci/ubuntu_python.gitlab-ci.yml b/.gitlab/ci/ubuntu_python.gitlab-ci.yml
index f52c94faa33cde5a79386765e7cbfed595dd0aeb..484e534e73c7469491ab83ba0b10bf6a84084ba8 100644
--- a/.gitlab/ci/ubuntu_python.gitlab-ci.yml
+++ b/.gitlab/ci/ubuntu_python.gitlab-ci.yml
@@ -10,7 +10,7 @@ build:ubuntu_python:
   needs: []
   tags:
     - docker
-  before_script:
+  before_script: &setup_ubuntu_build
     - !reference [.retrieve_deps:apt, script]
     - DEPENDENCY_JOB="build:ubuntu_python"
     - !reference [.ubuntu:download:artifacts, before_script]
@@ -41,10 +41,9 @@ test:ubuntu_python:
     - allow_failure: false
   tags:
     - docker
-  before_script:
+  before_script: &setup_ubuntu_test
     - !reference [.retrieve_deps:apt, script]
     - source venv/bin/activate
-    # - python -m pip install unittest-xml-reporting pytest
     - python -m pip install pytest
     - which python
     - python -m pip list