forked from loafle/openapi-generator-original
[Python] Updates python test framework to pytest (#4765)
* Switches python generators to use pytest, useNose CLI option added if to allow nose to be used instead * Adds ensure-up-to-date changes * Adds setup.cfg to python clients so we can configure nose when useNose=true * Adds fix for python-aiohttp testing, adds files missing from ensure-up-to-date
This commit is contained in:
committed by
William Cheng
parent
1084cd38a1
commit
3959530465
@@ -1,8 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
REQUIREMENTS_FILE=requirements.txt
|
||||
TEST_REQUIREMENTS_FILE=test-requirements.txt
|
||||
REQUIREMENTS_OUT=requirements.txt.log
|
||||
REQUIREMENTS_FILE=dev-requirements.txt
|
||||
REQUIREMENTS_OUT=dev-requirements.txt.log
|
||||
SETUP_OUT=*.egg-info
|
||||
VENV=.venv
|
||||
DEACTIVE=false
|
||||
@@ -12,16 +11,16 @@ export LANG=en_US.UTF-8
|
||||
|
||||
### set virtualenv
|
||||
if [ -z "$VIRTUAL_ENV" ]; then
|
||||
virtualenv $VENV --no-site-packages --always-copy --python python3
|
||||
virtualenv $VENV --no-site-packages --always-copy --python python3
|
||||
source $VENV/bin/activate
|
||||
DEACTIVE=true
|
||||
fi
|
||||
|
||||
### install dependencies
|
||||
pip install -r $REQUIREMENTS_FILE -r $TEST_REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
|
||||
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
|
||||
|
||||
### run tests
|
||||
pytest || exit 1
|
||||
tox || exit 1
|
||||
|
||||
### static analysis of code
|
||||
flake8 --show-source petstore_api/
|
||||
|
||||
Reference in New Issue
Block a user