From 465b777624f3e9bd9494b5e5fdcbab3dc0fb651f Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Thu, 31 Aug 2017 13:23:46 -0400 Subject: [PATCH] Fix python 3.6 escape char warnings in strings In python 3.6, escape sequences that are not recognized in string literals issue DeprecationWarnings. Convert these to raw strings. (This is the third patch for this issue.) Change-Id: Iebcd32aac4d52dbf3649cad51a5c38b0491fc8dd --- cinder/tests/unit/test_cmd.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cinder/tests/unit/test_cmd.py b/cinder/tests/unit/test_cmd.py index 96cced9fe3c..1c9b19401c7 100644 --- a/cinder/tests/unit/test_cmd.py +++ b/cinder/tests/unit/test_cmd.py @@ -1371,8 +1371,8 @@ class TestCinderRtstoolCmd(test.TestCase): mock_os.path.exists.return_value = False mock_os.makedirs.side_effect = OSError('error') - regexp = (u'targetcli not installed and could not create default ' - 'directory \(dirname\): error$') + regexp = (r'targetcli not installed and could not create default ' + r'directory \(dirname\): error$') self.assertRaisesRegexp(cinder_rtstool.RtstoolError, regexp, cinder_rtstool.save_to_file, None) @@ -1381,7 +1381,7 @@ class TestCinderRtstoolCmd(test.TestCase): def test_save_error_saving(self, mock_rtslib, mock_os): save = mock_rtslib.root.RTSRoot.return_value.save_to_file save.side_effect = OSError('error') - regexp = u'Could not save configuration to myfile: error' + regexp = r'Could not save configuration to myfile: error' self.assertRaisesRegexp(cinder_rtstool.RtstoolError, regexp, cinder_rtstool.save_to_file, 'myfile')