From 5b701b511d6f947acb0208101c8f2be5b81beaed Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Thu, 1 Nov 2018 22:18:31 -0500 Subject: [PATCH] Fix lint in unit tests re: py3-first and py2 compat Change-Id: Iaafe2c368390706a61976d3f13fd83d515ce4b3e --- unit_tests/test_ceph_broker.py | 2 +- unit_tests/test_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unit_tests/test_ceph_broker.py b/unit_tests/test_ceph_broker.py index b720d94..bae4b3d 100644 --- a/unit_tests/test_ceph_broker.py +++ b/unit_tests/test_ceph_broker.py @@ -28,7 +28,7 @@ class CephBrokerTestCase(unittest.TestCase): def test_process_requests_invalid_api_version(self, mock_log): req = json.dumps({'api-version': 2, 'ops': []}) rc = ceph_broker.process_requests(req) - print "Return: %s" % rc + print("Return: {}".format(rc)) self.assertEqual(json.loads(rc), {'exit-code': 1, 'stderr': 'Missing or invalid api version (2)'}) diff --git a/unit_tests/test_utils.py b/unit_tests/test_utils.py index 663a048..0a77482 100644 --- a/unit_tests/test_utils.py +++ b/unit_tests/test_utils.py @@ -110,7 +110,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 @contextmanager def stub_open(*args, **kwargs):