tests: update conftest.py

This commit is contained in:
Sina Atalay 2024-04-15 01:57:09 +03:00
parent fa75788fb4
commit e80fdd60c8
1 changed files with 3 additions and 3 deletions

View File

@ -198,14 +198,14 @@ def return_a_value_for_a_field_type(
bool: True,
}
if type(None) in typing.get_args(field_type):
if field in field_dictionary:
return field_dictionary[field]
elif type(None) in typing.get_args(field_type):
return return_a_value_for_a_field_type(field, field_type.__args__[0])
elif typing.get_origin(field_type) == typing.Literal:
return field_type.__args__[0]
elif typing.get_origin(field_type) == typing.Union:
return return_a_value_for_a_field_type(field, field_type.__args__[0])
elif field in field_dictionary:
return field_dictionary[field]
elif field_type in field_type_dictionary:
return field_type_dictionary[field_type]