Don't hardcode Python versions in test
As noted in change If8184c190e76d8cefb5b097f8fa8cb7564207103, the format of an internal error message changed in Python 3. There's no need to manually list each of these versions though - just ensure it's Python 3. Change-Id: Ie1a97d251c6098054bdc963acf53c3182b52b2aa Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Closes-Bug: #1855493
This commit is contained in:
committed by
Stephen Finucane
parent
6c704cc1c5
commit
0378c2c780
@@ -14,7 +14,6 @@
|
||||
|
||||
import copy
|
||||
import re
|
||||
import sys
|
||||
|
||||
import fixtures
|
||||
from jsonschema import exceptions as jsonschema_exc
|
||||
@@ -444,7 +443,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] in ['3.5', '3.6', '3.7']:
|
||||
if six.PY3:
|
||||
detail = "expected string or bytes-like object"
|
||||
else:
|
||||
detail = "expected string or buffer"
|
||||
|
||||
Reference in New Issue
Block a user