error message is different on py2 and py3
+import six
import unittest
from conans.model.options import OptionsValues, PackageOptions, Options, PackageOptionValues,\
option_undefined_msg
@@ -292,20 +293,22 @@ class OptionsValuesTest(unittest.TestCase):
"2442d43f1d558621069a15ff5968535f818939b5")
def test_loads_exceptions(self):
- with self.assertRaisesRegexp(ValueError, "not enough values to unpack"):
+ emsg = "not enough values to unpack" if six.PY3 else "need more than 1 value to unpack"
+ with self.assertRaisesRegexp(ValueError, emsg):
OptionsValues.loads("a=2\nconfig\nb=3")
- with self.assertRaisesRegexp(ValueError, "not enough values to unpack"):
+ with self.assertRaisesRegexp(ValueError, emsg):
OptionsValues.loads("config\na=2\ncommit\nb=3")
def test_exceptions_empty_value(self):
- with self.assertRaisesRegexp(ValueError, "not enough values to unpack"):
+ emsg = "not enough values to unpack" if six.PY3 else "need more than 1 value to unpack"
+ with self.assertRaisesRegexp(ValueError, emsg):
OptionsValues("a=2\nconfig\nb=3")
- with self.assertRaisesRegexp(ValueError, "not enough values to unpack"):
+ with self.assertRaisesRegexp(ValueError, emsg):
OptionsValues(("a=2", "config"))
- with self.assertRaisesRegexp(ValueError, "not enough values to unpack"):
+ with self.assertRaisesRegexp(ValueError, emsg):
OptionsValues([('a', 2), ('config', ), ])
def test_exceptions_repeated_value(self):
