@@ -66,20 +66,20 @@ def test_config_default_values(config_class):
6666 if origin is typing .Literal :
6767 # If the field is a Literal, ensure the value is one of the allowed options
6868 allowed_values = typing .get_args (expected_type )
69- assert (
70- value in allowed_values
71- ), f" { config_class . __name__ } . { attr } has incorrect value: expected one of { allowed_values } , got { value } "
69+ assert value in allowed_values , (
70+ f" { config_class . __name__ } . { attr } has incorrect value: expected one of { allowed_values } , got { value } "
71+ )
7272 elif origin is typing .Union :
7373 # For Union types (e.g., Optional[str]), check if value matches any type in the union
7474 allowed_types = typing .get_args (expected_type )
75- assert any (
76- isinstance ( value , t ) for t in allowed_types
77- ), f" { config_class . __name__ } . { attr } has incorrect type: expected one of { allowed_types } , got { type ( value ) } "
75+ assert any (isinstance ( value , t ) for t in allowed_types ), (
76+ f" { config_class . __name__ } . { attr } has incorrect type: expected one of { allowed_types } , got { type ( value ) } "
77+ )
7878 elif origin is not None :
7979 # If it's another generic type (e.g., list[str]), check against the base type
80- assert (
81- isinstance ( value , origin ) or value is None
82- ), f" { config_class . __name__ } . { attr } has incorrect type: expected { expected_type } , got { type ( value ) } "
80+ assert isinstance ( value , origin ) or value is None , (
81+ f" { config_class . __name__ } . { attr } has incorrect type: expected { expected_type } , got { type ( value ) } "
82+ )
8383 else :
8484 # Standard type check
8585 assert (
0 commit comments