Update test dependencies to latest version, fix some flake8 errors

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2019-01-09 11:14:08 -08:00
parent 5fc7f62ec4
commit 72f4f527ad
6 changed files with 15 additions and 14 deletions

View File

@ -273,7 +273,7 @@ class AuthConfig(dict):
'Password': data['Secret'],
})
return res
except dockerpycreds.CredentialsNotFound as e:
except dockerpycreds.CredentialsNotFound:
log.debug('No entry found')
return None
except dockerpycreds.StoreError as e:

View File

@ -51,8 +51,7 @@ class LogConfig(DictType):
... host_config=hc)
>>> client.inspect_container(container)['HostConfig']['LogConfig']
{'Type': 'json-file', 'Config': {'labels': 'production_status,geo', 'max-size': '1g'}}
""" # flake8: noqa
""" # noqa: E501
types = LogConfigTypesEnum
def __init__(self, **kwargs):
@ -320,10 +319,10 @@ class HostConfig(dict):
if not isinstance(ulimits, list):
raise host_config_type_error('ulimits', ulimits, 'list')
self['Ulimits'] = []
for l in ulimits:
if not isinstance(l, Ulimit):
l = Ulimit(**l)
self['Ulimits'].append(l)
for lmt in ulimits:
if not isinstance(lmt, Ulimit):
lmt = Ulimit(**lmt)
self['Ulimits'].append(lmt)
if log_config is not None:
if not isinstance(log_config, LogConfig):

View File

@ -67,7 +67,7 @@ setup(
url='https://github.com/docker/docker-py',
project_urls={
'Documentation': 'https://docker-py.readthedocs.io',
'Changelog': 'https://docker-py.readthedocs.io/en/stable/change-log.html', # flake8: noqa
'Changelog': 'https://docker-py.readthedocs.io/en/stable/change-log.html', # noqa: E501
'Source': 'https://github.com/docker/docker-py',
'Tracker': 'https://github.com/docker/docker-py/issues',
},

View File

@ -1,7 +1,9 @@
coverage==3.7.1
flake8==3.4.1
coverage==4.5.2
flake8==3.6.0; python_version != '3.3'
flake8==3.4.1; python_version == '3.3'
mock==1.0.1
pytest==2.9.1; python_version == '3.3'
pytest==3.6.3; python_version > '3.3'
pytest-cov==2.1.0
pytest==4.1.0; python_version != '3.3'
pytest-cov==2.6.1; python_version != '3.3'
pytest-cov==2.5.1; python_version == '3.3'
pytest-timeout==1.3.3

View File

@ -47,7 +47,7 @@ class ConnectionTimeoutTest(unittest.TestCase):
# This call isn't supposed to complete, and it should fail fast.
try:
res = self.client.inspect_container('id')
except:
except: # noqa: E722
pass
end = time.time()
assert res is None

View File

@ -14,7 +14,7 @@ from docker.types.services import convert_service_ports
try:
from unittest import mock
except:
except: # noqa: E722
import mock