From 7b9ed48f9e8e8e3c6ed6fd5bb5b9ca36567677c0 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Thu, 1 Nov 2018 22:17:58 -0500 Subject: [PATCH] Fix lint in unit tests re: py3-first and py2 compat Change-Id: Icdcbeaffac1b001dcffbbf9376ef2b90c373f170 --- tox.ini | 1 - unit_tests/testing.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index b6e41e7..03805ef 100644 --- a/tox.ini +++ b/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 diff --git a/unit_tests/testing.py b/unit_tests/testing.py index 3da1051..08c6db7 100644 --- a/unit_tests/testing.py +++ b/unit_tests/testing.py @@ -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):