From 3017531c82f611b5572079753f7ea3c74c3dd71e Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Mon, 19 Feb 2018 11:06:45 +0000 Subject: [PATCH] Fix PatternPropertiesTestCase for py 3.6 A python version check was only checking for 3.5. As noted in the pre-existing comment, an exception message is not a particularly stable interface so specific-to-minor-version check is maintained. Change-Id: I441b90e911fbac033e8cdea96114db22cba96ac5 Closes-Bug: #1750355 --- nova/tests/unit/test_api_validation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/tests/unit/test_api_validation.py b/nova/tests/unit/test_api_validation.py index 9e3312153415..7c6bad7424da 100644 --- a/nova/tests/unit/test_api_validation.py +++ b/nova/tests/unit/test_api_validation.py @@ -465,7 +465,7 @@ class PatternPropertiesTestCase(APIValidationTestCase): # Note(jrosenboom): This is referencing an internal python error # string, which is no stable interface. We need a patch in the # jsonschema library in order to fix this properly. - if sys.version[:3] == '3.5': + if sys.version[:3] in ['3.5', '3.6']: detail = "expected string or bytes-like object" else: detail = "expected string or buffer"