mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-08 19:44:57 -05:00
chore: fix a test which was failing on python 3.9 due to changed python semantics
This commit is contained in:
@@ -114,17 +114,20 @@ class Configuration:
|
||||
raise TypeError(f"Unexpected keyword argument '{name}'")
|
||||
|
||||
hint = hints[name]
|
||||
expected = None
|
||||
is_correctly_typed = True
|
||||
|
||||
if name == "insecure_key_cache_location":
|
||||
if not (value is None or isinstance(value, str)):
|
||||
is_correctly_typed = False
|
||||
expected = "Optional[str]"
|
||||
|
||||
elif not isinstance(value, hint): # type: ignore
|
||||
is_correctly_typed = False
|
||||
|
||||
if not is_correctly_typed:
|
||||
expected = hint.__name__ if hasattr(hint, "__name__") else str(hint)
|
||||
if expected is None:
|
||||
expected = hint.__name__ if hasattr(hint, "__name__") else str(hint)
|
||||
raise TypeError(
|
||||
f"Unexpected type for keyword argument '{name}' "
|
||||
f"(expected '{expected}', got '{type(value).__name__}')"
|
||||
|
||||
@@ -72,7 +72,7 @@ def test_configuration_fork():
|
||||
{"insecure_key_cache_location": 3},
|
||||
TypeError,
|
||||
"Unexpected type for keyword argument 'insecure_key_cache_location' "
|
||||
"(expected 'typing.Union[str, NoneType]', got 'int')",
|
||||
"(expected 'Optional[str]', got 'int')",
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user