Fix lint in unit tests re: py3-first and py2 compat
Change-Id: Icdcbeaffac1b001dcffbbf9376ef2b90c373f170
This commit is contained in:
parent
8692aa9fb6
commit
7b9ed48f9e
1
tox.ini
1
tox.ini
|
@ -32,7 +32,6 @@ deps = -r{toxinidir}/requirements.txt
|
|||
-r{toxinidir}/test-requirements.txt
|
||||
|
||||
[testenv:pep8]
|
||||
basepython = python2.7
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands = flake8 {posargs} hooks unit_tests tests actions lib
|
||||
|
|
|
@ -40,7 +40,7 @@ def load_config():
|
|||
|
||||
if not config:
|
||||
logging.error('Could not find config.yaml in any parent directory '
|
||||
'of %s. ' % file)
|
||||
'of %s. ' % __file__)
|
||||
raise Exception
|
||||
|
||||
return yaml.safe_load(open(config).read())['options']
|
||||
|
@ -127,7 +127,7 @@ def patch_open():
|
|||
|
||||
Yields the mock for "open" and "file", respectively.'''
|
||||
mock_open = MagicMock(spec=open)
|
||||
mock_file = MagicMock(spec=file)
|
||||
mock_file = MagicMock(spec=file) # noqa - transitional py2 py3 lint work-around
|
||||
|
||||
@contextmanager
|
||||
def stub_open(*args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue