Skip to content

Commit

Permalink
Merge branch 'feature/travis-integration' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlov99 committed Oct 28, 2017
2 parents ea087d1 + a5877e5 commit 712fae8
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 28 deletions.
35 changes: 17 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
language: python

python: "2.7"
# Use containers instead of full VMs for faster startup.
sudo: false

env:
- TOXENV=py27
- TOXENV=py33
- TOXENV=py34
- TOXENV=py35
- TOXENV=py36
- TOXENV=pypy
- TOXENV=cov
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "pypy"
- "pypy3"

branches:
only:
Expand All @@ -18,10 +19,8 @@ branches:

install: pip install --quiet tox

script: tox

after_script:
- if [ $TOXENV == "cov" ]; then
pip install --quiet coveralls;
coveralls;
fi
script:
# Remove version separator from python version and use it as a key for tox.
# Note: prefix it with 'py' for numbered python vestion.
- if [[ $TRAVIS_PYTHON_VERSION == 2* || $TRAVIS_PYTHON_VERSION == 3* ]]; then tox -e $(echo $TRAVIS_PYTHON_VERSION | sed 's/\.//g;s/^/py/'); fi
- if [[ $TRAVIS_PYTHON_VERSION == 'pypy'* ]]; then tox -e $TRAVIS_PYTHON_VERSION; fi
6 changes: 5 additions & 1 deletion jsonrpc/tests/test_backend_flask/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import json
import sys
from mock import patch

if sys.version_info < (3, 3):
from mock import patch
else:
from unittest.mock import patch

if sys.version_info < (2, 7):
import unittest2 as unittest
Expand Down
6 changes: 5 additions & 1 deletion jsonrpc/tests/test_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import sys
from mock import MagicMock

from ..manager import JSONRPCResponseManager
from ..jsonrpc2 import (
Expand All @@ -12,6 +11,11 @@
from ..jsonrpc1 import JSONRPC10Request, JSONRPC10Response
from ..exceptions import JSONRPCDispatchException

if sys.version_info < (3, 3):
from mock import MagicMock
else:
from unittest.mock import MagicMock

if sys.version_info < (2, 7):
import unittest2 as unittest
else:
Expand Down
8 changes: 6 additions & 2 deletions jsonrpc/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
""" Test utility functionality."""
from ..utils import JSONSerializable, DatetimeDecimalEncoder, is_invalid_params

import datetime
import decimal
import json
import sys
from mock import patch

from ..utils import JSONSerializable, DatetimeDecimalEncoder, is_invalid_params
if sys.version_info < (3, 3):
from mock import patch
else:
from unittest.mock import patch

if sys.version_info < (2, 7):
import unittest2 as unittest
Expand Down
54 changes: 48 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,61 @@
[tox]
envlist = py27, py33, py34, py35, py36, pypy, pep8, cov
envlist = py26, py27, py33, py34, py35, py36, pypy, pypy3, pep8, cov

[testenv]
commands = nosetests
setenv = DJANGO_SETTINGS_MODULE=jsonrpc.tests.test_backend_django.settings
deps =
nose
mock
django==1.10
flask>=0.10.1
nose==1.3.7
Flask==0.12.2

# Python 2.6 configuration. Latest Django support is 1.6
[testenv:py26]
deps =
unittest2
Django==1.6
Flask==0.12.2
mock==2.0.0
nose==1.3.7
unittest2==1.1.0

# Python 2.7 configuration.
# Django 1.11 is likely to be the last version to support Python 2.7
# https://www.djangoproject.com/weblog/2015/jun/25/roadmap/
[testenv:py27]
deps =
{[testenv]deps}
mock==2.0.0
Django==1.11

[testenv:py33]
deps =
{[testenv]deps}
django==1.11

[testenv:py34]
deps =
{[testenv]deps}
django==1.11

[testenv:py35]
deps =
{[testenv]deps}
django==1.11

[testenv:py36]
deps =
{[testenv]deps}
django==1.11

[testenv:pypy]
deps =
{[testenv]deps}
mock==2.0.0
django==1.11

[testenv:pypy3]
deps =
{[testenv]deps}
django==1.11

[testenv:pep8]
deps = pep8
Expand Down

0 comments on commit 712fae8

Please sign in to comment.