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

Change-Id: Iaafe2c368390706a61976d3f13fd83d515ce4b3e
This commit is contained in:
Ryan Beisner 2018-11-01 22:18:31 -05:00
parent 06ac9046a1
commit 5b701b511d
No known key found for this signature in database
GPG Key ID: 952BACDC1C1A05FB
2 changed files with 2 additions and 2 deletions

View File

@ -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)'})

View File

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