Respect usenose for Python CI (#5376)

* python: Respect useNose option in generated CI templates

Travis and Gitlab CI now use nosetests or pytests depending on the "useNose" option that is passed.

* python: Update CI samples

They now respect the "useNose" option
This commit is contained in:
LoveIsGrief 2020-02-20 14:47:13 +01:00 committed by GitHub
parent fa5beeecd0
commit 33483b2f20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 50 additions and 26 deletions

View File

@ -7,8 +7,13 @@ stages:
stage: test
script:
- pip install -r requirements.txt
- pip install nose
- pip install -r test-requirements.txt
{{#useNose}}
- nosetests
{{/useNose}}
{{^useNose}}
- pytest --cov={{{packageName}}}
{{/useNose}}
nosetest-2.7:
extends: .nosetest

View File

@ -10,6 +10,13 @@ python:
- "3.7"
- "3.8"
# command to install dependencies
install: "pip install -r requirements.txt"
install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
# command to run tests
{{#useNose}}
script: nosetests
{{/useNose}}
{{^useNose}}
script: pytest --cov={{{packageName}}}
{{/useNose}}

View File

@ -7,8 +7,8 @@ stages:
stage: test
script:
- pip install -r requirements.txt
- pip install nose
- nosetests
- pip install -r test-requirements.txt
- pytest --cov=petstore_api
nosetest-2.7:
extends: .nosetest

View File

@ -10,6 +10,8 @@ python:
- "3.7"
- "3.8"
# command to install dependencies
install: "pip install -r requirements.txt"
install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
# command to run tests
script: nosetests
script: pytest --cov=petstore_api

View File

@ -7,8 +7,8 @@ stages:
stage: test
script:
- pip install -r requirements.txt
- pip install nose
- nosetests
- pip install -r test-requirements.txt
- pytest --cov=petstore_api
nosetest-2.7:
extends: .nosetest

View File

@ -10,6 +10,8 @@ python:
- "3.7"
- "3.8"
# command to install dependencies
install: "pip install -r requirements.txt"
install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
# command to run tests
script: nosetests
script: pytest --cov=petstore_api

View File

@ -7,8 +7,8 @@ stages:
stage: test
script:
- pip install -r requirements.txt
- pip install nose
- nosetests
- pip install -r test-requirements.txt
- pytest --cov=petstore_api
nosetest-2.7:
extends: .nosetest

View File

@ -10,6 +10,8 @@ python:
- "3.7"
- "3.8"
# command to install dependencies
install: "pip install -r requirements.txt"
install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
# command to run tests
script: nosetests
script: pytest --cov=petstore_api

View File

@ -7,8 +7,8 @@ stages:
stage: test
script:
- pip install -r requirements.txt
- pip install nose
- nosetests
- pip install -r test-requirements.txt
- pytest --cov=petstore_api
nosetest-2.7:
extends: .nosetest

View File

@ -10,6 +10,8 @@ python:
- "3.7"
- "3.8"
# command to install dependencies
install: "pip install -r requirements.txt"
install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
# command to run tests
script: nosetests
script: pytest --cov=petstore_api

View File

@ -7,8 +7,8 @@ stages:
stage: test
script:
- pip install -r requirements.txt
- pip install nose
- nosetests
- pip install -r test-requirements.txt
- pytest --cov=petstore_api
nosetest-2.7:
extends: .nosetest

View File

@ -10,6 +10,8 @@ python:
- "3.7"
- "3.8"
# command to install dependencies
install: "pip install -r requirements.txt"
install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
# command to run tests
script: nosetests
script: pytest --cov=petstore_api

View File

@ -7,8 +7,8 @@ stages:
stage: test
script:
- pip install -r requirements.txt
- pip install nose
- nosetests
- pip install -r test-requirements.txt
- pytest --cov=petstore_api
nosetest-2.7:
extends: .nosetest

View File

@ -10,6 +10,8 @@ python:
- "3.7"
- "3.8"
# command to install dependencies
install: "pip install -r requirements.txt"
install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
# command to run tests
script: nosetests
script: pytest --cov=petstore_api