-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[python-asyncio] tests and fixes (#7235)
* fix: creating ssl context and passing args/files/forms * feat: python-async add tests * chore: rebuild petstore sample for python, tornado and asyncio * feat: add python asyncio to travis * feat: print coverage (python-asyncio)
- Loading branch information
Showing
20 changed files
with
392 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
modules/swagger-codegen/src/main/resources/python/test-requirements.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
{{^asyncio}} | ||
coverage>=4.0.3 | ||
nose>=1.3.7 | ||
{{/asyncio}} | ||
{{#asyncio}} | ||
pytest>=3.3.1 | ||
pytest-cov>=2.5.1 | ||
{{/asyncio}} | ||
pluggy>=0.3.1 | ||
py>=1.4.31 | ||
randomize>=0.13 |
14 changes: 12 additions & 2 deletions
14
modules/swagger-codegen/src/main/resources/python/tox.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
[tox] | ||
{{^asyncio}} | ||
envlist = py27, py3 | ||
{{/asyncio}} | ||
{{#asyncio}} | ||
envlist = py3 | ||
{{/asyncio}} | ||
|
||
[testenv] | ||
deps=-r{toxinidir}/requirements.txt | ||
-r{toxinidir}/test-requirements.txt | ||
|
||
commands= | ||
{{^asyncio}} | ||
nosetests \ | ||
[] | ||
[] | ||
{{/asyncio}} | ||
{{#asyncio}} | ||
pytest -v --cov petstore_api | ||
{{/asyncio}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
REQUIREMENTS_FILE=dev-requirements.txt | ||
REQUIREMENTS_OUT=dev-requirements.txt.log | ||
SETUP_OUT=*.egg-info | ||
VENV=.venv | ||
|
||
clean: | ||
rm -rf $(REQUIREMENTS_OUT) | ||
rm -rf $(SETUP_OUT) | ||
rm -rf $(VENV) | ||
rm -rf .tox | ||
rm -rf .coverage | ||
find . -name "*.py[oc]" -delete | ||
find . -name "__pycache__" -delete | ||
|
||
test-all: clean | ||
bash ./test_python3.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
tox | ||
coverage | ||
randomize | ||
flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>io.swagger</groupId> | ||
<artifactId>PythonAsyncioClientTests</artifactId> | ||
<packaging>pom</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>Python Asyncio Petstore Client</name> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>1.2.1</version> | ||
<executions> | ||
<execution> | ||
<id>pytest-test</id> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>make</executable> | ||
<arguments> | ||
<argument>test-all</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
coverage>=4.0.3 | ||
nose>=1.3.7 | ||
pytest>=3.3.1 | ||
pytest-cov>=2.5.1 | ||
pluggy>=0.3.1 | ||
py>=1.4.31 | ||
randomize>=0.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
REQUIREMENTS_FILE=dev-requirements.txt | ||
REQUIREMENTS_OUT=dev-requirements.txt.log | ||
SETUP_OUT=*.egg-info | ||
VENV=.venv | ||
DEACTIVE=false | ||
|
||
export LC_ALL=en_US.UTF-8 | ||
export LANG=en_US.UTF-8 | ||
|
||
### set virtualenv | ||
if [ -z "$VIRTUAL_ENV" ]; then | ||
virtualenv $VENV --no-site-packages --always-copy --python python3 | ||
source $VENV/bin/activate | ||
DEACTIVE=true | ||
fi | ||
|
||
### install dependencies | ||
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT | ||
python setup.py develop | ||
|
||
### run tests | ||
tox || exit 1 | ||
|
||
### static analysis of code | ||
flake8 --show-source petstore_api/ | ||
|
||
### deactivate virtualenv | ||
#if [ $DEACTIVE == true ]; then | ||
# deactivate | ||
#fi |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Oops, something went wrong.