diff --git a/.travis.yml b/.travis.yml index 21a2de5..a00b794 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 61af1ba..6502a2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/payplug/__version__.py b/payplug/__version__.py index 67a20ab..495a173 100644 --- a/payplug/__version__.py +++ b/payplug/__version__.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = '1.2.1' +__version__ = '1.2.2' diff --git a/payplug/test/test_init/test_dao_card.py b/payplug/test/test_init/test_dao_card.py index fc44de3..267c3b3 100644 --- a/payplug/test/test_init/test_dao_card.py +++ b/payplug/test/test_init/test_dao_card.py @@ -57,7 +57,6 @@ def test_delete_with_card_object(self): assert res is None -@pytest.fixture def cards_list_fixture(): return { "type": "list", diff --git a/payplug/test/test_init/test_dao_customer.py b/payplug/test/test_init/test_dao_customer.py index e21b719..3b4424b 100644 --- a/payplug/test/test_init/test_dao_customer.py +++ b/payplug/test/test_init/test_dao_customer.py @@ -49,7 +49,6 @@ def test_delete_with_customer_object(self): assert res is None -@pytest.fixture def customers_list_fixture(): return { "type": "list", diff --git a/payplug/test/test_init/test_dao_payment.py b/payplug/test/test_init/test_dao_payment.py index 8a5e0e5..06275fd 100644 --- a/payplug/test/test_init/test_dao_payment.py +++ b/payplug/test/test_init/test_dao_payment.py @@ -37,7 +37,6 @@ def test_create(self): assert payment.id == 'pay_payment_id' -@pytest.fixture def get_payments_fixture(): return { "type": "list", diff --git a/payplug/test/test_init/test_dao_refund.py b/payplug/test/test_init/test_dao_refund.py index 8bb1d1a..cd6bc29 100644 --- a/payplug/test/test_init/test_dao_refund.py +++ b/payplug/test/test_init/test_dao_refund.py @@ -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", diff --git a/payplug/test/test_resources/test_payment.py b/payplug/test/test_resources/test_payment.py index dd3d401..14aa849 100644 --- a/payplug/test/test_resources/test_payment.py +++ b/payplug/test/test_resources/test_payment.py @@ -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", diff --git a/payplug/test/test_resources/test_refund.py b/payplug/test/test_resources/test_refund.py index 8235018..fbeb508 100644 --- a/payplug/test/test_resources/test_refund.py +++ b/payplug/test/test_resources/test_refund.py @@ -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", diff --git a/setup.py b/setup.py index a4c7190..7a8f12c 100644 --- a/setup.py +++ b/setup.py @@ -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__, @@ -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' ], @@ -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 diff --git a/tox.ini b/tox.ini index bdad4a7..fac4e52 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,12 @@ [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 @@ -13,27 +14,14 @@ deps = ; 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} \ No newline at end of file