We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 254db14 commit f9a6651Copy full SHA for f9a6651
1 file changed
tests/test_display_utils.py
@@ -50,6 +50,15 @@ def test_format_string_key_for_error_returns_normalized_key():
50
assert format_string_key_for_error(" \nkey\t ", max_length=20) == "?key?"
51
52
53
+def test_format_string_key_for_error_uses_default_length_for_non_int_max_length():
54
+ assert format_string_key_for_error("key", max_length="invalid") == "key" # type: ignore[arg-type]
55
+
56
57
+def test_format_string_key_for_error_uses_default_length_for_non_positive_max_length():
58
+ assert format_string_key_for_error("key", max_length=0) == "key"
59
+ assert format_string_key_for_error("key", max_length=-5) == "key"
60
61
62
def test_format_string_key_for_error_returns_blank_fallback_for_empty_keys():
63
assert format_string_key_for_error(" ", max_length=20) == "<blank key>"
64
0 commit comments