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'], 'Password': data['Secret'],
}) })
return res return res
except dockerpycreds.CredentialsNotFound as e: except dockerpycreds.CredentialsNotFound:
log.debug('No entry found') log.debug('No entry found')
return None return None
except dockerpycreds.StoreError as e: except dockerpycreds.StoreError as e:

View File

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

View File

@ -67,7 +67,7 @@ setup(
url='https://github.com/docker/docker-py', url='https://github.com/docker/docker-py',
project_urls={ project_urls={
'Documentation': 'https://docker-py.readthedocs.io', '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', 'Source': 'https://github.com/docker/docker-py',
'Tracker': 'https://github.com/docker/docker-py/issues', 'Tracker': 'https://github.com/docker/docker-py/issues',
}, },

View File

@ -1,7 +1,9 @@
coverage==3.7.1 coverage==4.5.2
flake8==3.4.1 flake8==3.6.0; python_version != '3.3'
flake8==3.4.1; python_version == '3.3'
mock==1.0.1 mock==1.0.1
pytest==2.9.1; python_version == '3.3' pytest==2.9.1; python_version == '3.3'
pytest==3.6.3; python_version > '3.3' pytest==4.1.0; python_version != '3.3'
pytest-cov==2.1.0 pytest-cov==2.6.1; python_version != '3.3'
pytest-cov==2.5.1; python_version == '3.3'
pytest-timeout==1.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. # This call isn't supposed to complete, and it should fail fast.
try: try:
res = self.client.inspect_container('id') res = self.client.inspect_container('id')
except: except: # noqa: E722
pass pass
end = time.time() end = time.time()
assert res is None assert res is None

View File

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