Fix UUID datatype typecast issue.

This commit is contained in:
Khushboo Vashi 2023-03-27 11:38:57 +05:30 committed by GitHub
parent 636ab5cbab
commit 7ce03f3bea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 16 deletions

View File

@ -106,9 +106,9 @@ ALL_JSON_TYPES = PSYCOPG_SUPPORTED_JSON_TYPES +\
# OID reference psycopg/lib/_ipaddress.py
PSYCOPG_SUPPORTED_IPADDRESS_ARRAY_TYPES = (1041, 651)
# uuid[]
# uuid[], uuid
# OID reference psycopg/lib/extras.py
PSYCOPG_SUPPORTED_IPADDRESS_ARRAY_TYPES = (2951,)
PSYCOPG_SUPPORTED_IPADDRESS_ARRAY_TYPES = (2951, 2950)
# int4range, int8range, numrange, daterange tsrange, tstzrange[]
# OID reference psycopg/lib/_range.py
@ -132,15 +132,8 @@ def register_global_typecasters():
psycopg.adapters.register_loader(typ,
TextLoaderpgAdmin)
#
# # define type caster to convert pg array types of above types into
# # array of string type
# pg_array_types_to_array_of_string_type = \
# psycopg.extensions.new_array_type(
# TO_ARRAY_OF_STRING_DATATYPES,
# 'TYPECAST_TO_ARRAY_OF_STRING', pg_types_to_string_type
# )
# Define type caster to convert pg array types of above types into
# array of string type
for typ in TO_ARRAY_OF_STRING_DATATYPES:
psycopg.adapters.register_loader(typ, TextLoaderpgAdmin)

View File

@ -62,18 +62,15 @@ class BaseFeatureTest(BaseTestGenerator):
pass
def tearDown(self):
python2_failures = hasattr(
self, "_resultForDoCleanups") and self.current_test_failed()
python3_failures = hasattr(self, '_outcome') and self.any_step_failed()
if python2_failures or python3_failures:
if python3_failures:
self._screenshot()
self.after()
def any_step_failed(self):
for step in self._outcome.errors:
for step in self._outcome.result.errors:
if step[1] is not None:
return True
return False