steps:
  - task: UsePythonVersion@0
    displayName: ${{format('Setup Python {0}', parameters.python_version)}}
    inputs:
      versionSpec: '${{parameters.python_version}}'

  - template: install_deps.yml

  - script: 'pipenv run make coverage'
    displayName: Run Tests with Coverage

  - task: PublishTestResults@2
    displayName: Publish Test Results
    inputs:
      testResultsFiles: 'test-results.xml'
      mergeTestResults: true
      testRunTitle: ${{format('$(agent.os) Python {0}', parameters.python_version)}}
      platform: Linux
    condition: succeededOrFailed()

  - task: PublishCodeCoverageResults@1
    displayName: Publish Code Coverage Results
    inputs:
      codeCoverageTool: 'cobertura'
      summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
      reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov'
      failIfCoverageEmpty: true
  
  - script: 'pipenv run python -m codecov --token $(CODECOV_TOKEN) --required --name "$(agent.os)-$(parameters.python_version)" --build "$(Build.DefinitionName)" --env OS=$(agent.os) python=$(parameters.python_version)'
    displayName: Upload to codecov.io
    condition: succeeded()

steps:
  - task: UsePythonVersion@0
    displayName: ${{format('Setup Python {0}', parameters.python_version)}}
    inputs:
      versionSpec: '${{parameters.python_version}}'

  - template: install_deps.yml

  - script: 'pipenv run make coverage'
    displayName: Run Tests with Coverage

  - task: PublishTestResults@2
    displayName: Publish Test Results
    inputs:
      testResultsFiles: 'test-results.xml'
      mergeTestResults: true
      testRunTitle: ${{format('$(agent.os) Python {0}', parameters.python_version)}}
      platform: Linux
    condition: succeededOrFailed()

  - task: PublishCodeCoverageResults@1
    displayName: Publish Code Coverage Results
    inputs:
      codeCoverageTool: 'cobertura'
      summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
      reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov'
      failIfCoverageEmpty: true
  
  - script: ${{format('pipenv run python -m codecov --token $(CODECOV_TOKEN) --required --name "$(agent.os)-{0}" --build "$(Build.DefinitionName)" --env OS=$(agent.os) python={0}', parameters.python_version)}}
    displayName: Upload to codecov.io
    condition: succeeded()

Fix formatting with template parameter
Fix formatting with template parameter
