We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3df331a commit 585eadaCopy full SHA for 585eada
tests/test_display_utils.py
@@ -64,3 +64,26 @@ def test_format_string_key_for_error_uses_default_fallback_for_invalid_blank_fal
64
format_string_key_for_error(" ", max_length=20, blank_fallback=123)
65
== "<blank key>"
66
)
67
+
68
69
+def test_format_string_key_for_error_rejects_string_subclass_keys():
70
+ class _StringSubclass(str):
71
+ pass
72
73
+ assert format_string_key_for_error(_StringSubclass("key"), max_length=20) == (
74
+ "<blank key>"
75
+ )
76
77
78
+def test_format_string_key_for_error_rejects_string_subclass_blank_fallbacks():
79
80
81
82
+ assert (
83
+ format_string_key_for_error(
84
+ " ",
85
+ max_length=20,
86
+ blank_fallback=_StringSubclass("<custom>"),
87
88
+ == "<blank key>"
89
0 commit comments