Fix lint in unit tests re: py3-first and py2 compat

Change-Id: Icdcbeaffac1b001dcffbbf9376ef2b90c373f170
This commit is contained in:
Ryan Beisner 2018-11-01 22:17:58 -05:00
parent 8692aa9fb6
commit 7b9ed48f9e
No known key found for this signature in database
GPG Key ID: 952BACDC1C1A05FB
2 changed files with 2 additions and 3 deletions

View File

@ -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

View File

@ -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):