diff --git a/.travis.yml b/.travis.yml index 8d33b4e..52f1629 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: python python: - - "3.4" - "3.5" - "3.6" matrix: diff --git a/README.rst b/README.rst index bfa6076..bc34d33 100644 --- a/README.rst +++ b/README.rst @@ -152,6 +152,7 @@ Requires - pytest >= 2.2.3 - requests >= 2.13.0 - six +- retry>=0.9.2 Installation ============ diff --git a/pytest_jira.py b/pytest_jira.py index f49a525..c5a17cb 100644 --- a/pytest_jira.py +++ b/pytest_jira.py @@ -11,11 +11,13 @@ import os import re import sys +from distutils.version import LooseVersion +from json import JSONDecodeError import pytest import requests import six -from distutils.version import LooseVersion +from retry import retry DEFAULT_RESOLVE_STATUSES = 'closed', 'resolved' DEFAULT_RUN_TEST_CASE = True @@ -214,6 +216,7 @@ def check_connection(self): self.is_connected = True return True + @retry(JSONDecodeError, tries=3, delay=2) def get_issue(self, issue_id): if not self.is_connected: self.check_connection() diff --git a/requirements-pytest2.txt b/requirements-pytest2.txt deleted file mode 100644 index 2aff6ee..0000000 --- a/requirements-pytest2.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=2.2.4,<3.0.0 -requests>=2.13.0 -six diff --git a/requirements-pytest3.txt b/requirements-pytest3.txt deleted file mode 100644 index 1551474..0000000 --- a/requirements-pytest3.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=2.2.4,<4.0.0 -six -requests>=2.13.0 diff --git a/requirements.txt b/requirements.txt index 513bf2c..f2a700d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ pytest>=2.2.4 six requests>=2.13.0 +retry>=0.9.2 diff --git a/setup.cfg b/setup.cfg index cd556df..f5831b2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,6 @@ classifier= Operating System :: POSIX Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 diff --git a/tox.ini b/tox.ini index 6b3bccc..2f41323 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,6 @@ [tox] -envlist = py34-pytest2,py34-pytest3,py34,py35,py36,py37,pep8 +envlist = py35,py36,py37,pep8 [tox:travis] -3.4 = py34, pep8, py34-pytest2, py34-pytest3 3.5 = py35, pep8 3.6 = py36, pep8 3.7 = py37, pep8 @@ -17,21 +16,3 @@ commands= coverage report [testenv:pep8] commands=flake8 setup.py pytest_jira.py tests -[testenv:py34-pytest2] -deps= - -rtests/requirements.txt - -rrequirements-pytest2.txt -setenv = - PYTEST_ADDOPTS=-p pytester --basetemp={envtmpdir} -commands= - coverage run --source pytest_jira -m py.test - coverage report -[testenv:py34-pytest3] -deps= - -rtests/requirements.txt - -rrequirements-pytest3.txt -setenv = - PYTEST_ADDOPTS=-p pytester --basetemp={envtmpdir} -commands= - coverage run --source pytest_jira -m py.test - coverage report