Running Flask App in Background

I’m not sure what’s happening, this issue does not seem to be due to background: true
I have removed it and now my build freezes anyway. It executes api/run.py as described below but unit tests are not being executed by nose2.

  - run:
      name: Run Tests
      command: |
        . dq/bin/activate
        python3 api/run.py
        nose2 --plugin nose2.plugins.junitxml --junit-xml -v

I don’t understand why.
Tests run fine locally.
Any help would be appreciated