diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..6fd7727c2 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,51 @@ +# Python package +# Create and test a Python package on multiple Python versions. +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +trigger: +- master + +pool: + vmImage: 'windows-latest' +strategy: + matrix: + Python38: + python.version: '3.8.2' + +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + displayName: 'Use Python $(python.version)' + +- script: | + python -m pip install --upgrade pip + pip install -r requirements.txt + displayName: 'Install dependencies' +- script: + echo date + +- script: | + pip install pytest pytest-azurepipelines + pytest + displayName: 'pytest' + + +- task: SynopsysDetectTask@2 + inputs: + Products: 'BD' + BlackDuckService: 'BlackDuck-ADO-Test-Python3.8' + DetectVersion: 'latest' + DetectArguments: | + --blackduck.trust.cert=true + --detect.project.name="python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" + --detect.project.version.name="1.0.0" + --detect.code.location.name="python-sample-vscode-flask-tutorial-azure-$(Build.BuildId)" + --detect.project.version.phase="DEVELOPMENT" + --detect.detector.search.depth="1" + --detect.project.tier="1" + --logging.level.detect="DEBUG" + --logging.level.com.synopsys.integration="DEBUG" + --blackduck.timeout=120 + --detect.report.timeout=300 diff --git a/test_test1.py b/test_test1.py index df1dc6821..c745113c0 100644 --- a/test_test1.py +++ b/test_test1.py @@ -1 +1,8 @@ -print('Hello World') +import unittest + +def func(x): + return x + 2 + +def test_func(): + assert func(2) == 4 +