-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[python-asyncio] tests and fixes #7235
Merged
wing328
merged 5 commits into
swagger-api:master
from
tomplus:feature/python-asyncio-tests
Feb 1, 2018
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
460985d
fix: creating ssl context and passing args/files/forms
tomplus 2ac3766
feat: python-async add tests
tomplus ddf4d6b
chore: rebuild petstore sample for python, tornado and asyncio
tomplus 170161b
feat: add python asyncio to travis
tomplus 5055d39
feat: print coverage (python-asyncio)
tomplus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 5 additions & 0 deletions
5
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,10 @@ | ||
coverage>=4.0.3 | ||
{{^asyncio}} | ||
nose>=1.3.7 | ||
{{/asyncio}} | ||
{{#asyncio}} | ||
pytest>=3.3.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 | ||
{{/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 | ||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asyncio
with coroutine function definition requires Python 3.5+. I also switched fromnosetest
topytest
which supports asyncio.