Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 5 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,26 @@
language: python

python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
- "pypy"
- "pypy3"

env:
- REQUESTS=1.0
- REQUESTS=1.1
- REQUESTS=1.2
- REQUESTS=2.0
- REQUESTS=2.1
- REQUESTS=2.2
- REQUESTS=2.3
- REQUESTS=2.4
- REQUESTS=2.5
- REQUESTS=2.6
- REQUESTS=2.7
- REQUESTS=2.8
- REQUESTS=2.9
- REQUESTS=2.10
- REQUESTS=2.11
- REQUESTS=2.21
- REQUESTS=2.22
- REQUESTS=dev

cache: pip

matrix:
fast_finish: true
exclude:
# No support for Python 3.4+ in requests 1.x
- python: "3.4"
env: REQUESTS=1.0
- python: "3.4"
env: REQUESTS=1.1
- python: "3.4"
env: REQUESTS=1.2
- python: "3.5"
env: REQUESTS=1.0
- python: "3.5"
env: REQUESTS=1.1
- python: "3.5"
env: REQUESTS=1.2

# No support for Python 3.2- in virtualenv 14+
install:
- travis_retry pip install "virtualenv<14.0.0" "tox>=1.9"
- travis_retry pip install "virtualenv<14.0.0" "tox>=1.9" "pip>9.0.1"

script:
- tox -e py$(echo $(echo $TRAVIS_PYTHON_VERSION | sed -e 's/pypy/py/')-requests$REQUESTS | tr -d .)-travis -- --cov=payplug
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.2.2
-----
- Fix deprecated message for pytest fixtures.
- Specify pytest version for python2 and python3 compatibility.

1.2.1
-----
- Require pyOpenSSL>=0.15 to prevent random failures.
Expand Down
2 changes: 1 addition & 1 deletion payplug/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = '1.2.1'
__version__ = '1.2.2'
1 change: 0 additions & 1 deletion payplug/test/test_init/test_dao_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def test_delete_with_card_object(self):
assert res is None


@pytest.fixture
def cards_list_fixture():
return {
"type": "list",
Expand Down
1 change: 0 additions & 1 deletion payplug/test/test_init/test_dao_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def test_delete_with_customer_object(self):
assert res is None


@pytest.fixture
def customers_list_fixture():
return {
"type": "list",
Expand Down
1 change: 0 additions & 1 deletion payplug/test/test_init/test_dao_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def test_create(self):
assert payment.id == 'pay_payment_id'


@pytest.fixture
def get_payments_fixture():
return {
"type": "list",
Expand Down
1 change: 0 additions & 1 deletion payplug/test/test_init/test_dao_refund.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def test_create_with_payment_object(self, url_mock):
assert isinstance(refund, resources.Refund)


@pytest.fixture
def get_refunds_fixture():
return {
"type": "list",
Expand Down
1 change: 0 additions & 1 deletion payplug/test/test_resources/test_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def test_abort_payment(self, payment_abort_mock):
payment_abort_mock.assert_called_once_with(payment)


@pytest.fixture
def payment_fixture():
return {
"id": "pay_5iHMDxy4ABR4YBVW4UscIn",
Expand Down
1 change: 0 additions & 1 deletion payplug/test/test_resources/test_refund.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def test_initialize_refund(self):
assert refund_object.metadata['reason'] == "The delivery was delayed"


@pytest.fixture
def refund_fixture():
return {
"id": "re_5iHMDxy4ABR4YBVW4UscIn",
Expand Down
17 changes: 11 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def run_tests(self):
errno = pytest.main(self.pytest_args)
sys.exit(errno)


# Manage dependancies between python2 and 3
if sys.version_info.major == 2:
pytest_version = 'pytest<5'
else:
pytest_version = 'pytest>=5,<6'


setup(
name='payplug',
version=__version__,
Expand All @@ -57,14 +65,11 @@ def run_tests(self):
'License :: OSI Approved :: MIT License',

'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: PyPy'
],

Expand All @@ -73,7 +78,7 @@ def run_tests(self):
packages=find_packages(exclude=['*.test*']),

install_requires=['requests>=1.0.1,<3.0', 'six>=1.4.0', 'pyOpenSSL>=0.15'],
tests_require=['pytest>=2.7.0', 'mock>=1.0.1,<2.0', 'six>=1.7.0'],
tests_require=[pytest_version, 'mock>=1.0.1,<2.0', 'six>=1.7.0'],

# If there are data files included in your packages that need to be
# installed, specify them here. If using Python 2.6 or less, then these
Expand Down
26 changes: 7 additions & 19 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,39 +1,27 @@
[tox]
; No support for Python 3.4+ in requests 1.x
envlist =
py{26,27,33,py,py3}-requests{10,11,12,20,21,22,23,24,25,26,27,28,29,210,211,dev},
py{34,35}-requests{20,21,22,23,24,25,26,27,28,29,210,211,dev}
py{27,py,py3}-requests{221,222,dev},
py{35,36,37}-requests{221,222,dev}

[testenv]
deps =
pip>9.0.1
pytest>=2.7.0
pytest-cov>=2.2
; Uncomment this if you want to test with a six version lower than 1.7.0 since mock depends on six.wraps which was
; released a bit later.
; mock==1.0.1
mock>=1.0.1
six>=1.4.0
requests10: requests>=1.0.1,<1.1
requests11: requests>=1.1,<1.2
requests12: requests>=1.2,<1.3
requests20: requests>=2.0,<2.1
requests21: requests>=2.1,<2.2
requests22: requests>=2.2,<2.3
requests23: requests>=2.3,<2.4
requests24: requests>=2.4,<2.5
requests25: requests>=2.5,<2.6
requests26: requests>=2.6,<2.7
requests27: requests>=2.7,<2.8
requests28: requests>=2.8,<2.9
requests29: requests>=2.9,<2.10
requests210: requests>=2.10,<2.11
requests211: requests>=2.11,<2.12
requests221: requests>=2.20,<2.21
requests222: requests>=2.21,<2.22
requestsdev: https://github.com/kennethreitz/requests/tarball/master
; Travis CI runs on Debian Jessie which provides outdated Pypy versions (<2.6) that are incompatible with
; cryptography >= 1.0.
; We have to force cryptography < 1.0 in this case.
; We also force pyOpenSSL < 16.0 because newer versions requires cryptography>=1.3.
; See https://github.com/travis-ci/travis-ci/issues/4756
py{py,py3}-travis: pyOpenSSL<16.0
py{py,py3}-travis: cryptography<1.0
; py{py,py3}-travis: pyOpenSSL<16.0
; py{py,py3}-travis: cryptography<1.0
commands=py.test {posargs}