From 3f665f33098cd960e932658d2c614020019c99ee Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Fri, 24 Aug 2018 08:05:59 -0400 Subject: [PATCH] py36: Fix unit tests Unit tests were only working on py35 and not py36, this is because the unit test in test_api_validations were only checking for py35. Use the six library to detect the python version used. Change-Id: Iab10228e911a9efc0e18b04667596342ee949642 Signed-off-by: Chuck Short --- karbor/tests/unit/api/test_api_validation.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/karbor/tests/unit/api/test_api_validation.py b/karbor/tests/unit/api/test_api_validation.py index 1821441c..4ccc60cb 100644 --- a/karbor/tests/unit/api/test_api_validation.py +++ b/karbor/tests/unit/api/test_api_validation.py @@ -11,7 +11,6 @@ # under the License. import re -import sys import fixtures import six @@ -234,7 +233,7 @@ class PatternPropertiesTestCase(APIValidationTestCase): self.check_validation_error(self.post, body={'0123456789a': 'bar'}, expected_detail=details) - if sys.version[:3] == '3.5': + if six.PY3: detail = "expected string or bytes-like object" else: detail = "expected string or buffer"