Skip to content

Commit 4f93458

Browse files
committed
Fixed linter error (lines > 88), and typing error dict->Dict.
1 parent e6e6247 commit 4f93458

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/test_lex.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,20 @@ def cases() -> List[Case]:
2626
# Deserialize tests/test_lex.json into Case objects with want as List[Token]
2727
# Build mapping from token constant names used in JSON (e.g., "TOKEN_ROOT")
2828
# to actual token kind values (e.g., "ROOT").
29-
kind_map = {name: getattr(tokmod, name) for name in dir(tokmod) if name.startswith("TOKEN_")}
30-
# Backward-compatibility alias: some test data may use PSEUDO_ROOT to mean FAKE_ROOT
29+
kind_map = {name: getattr(tokmod, name) for name in dir(tokmod)
30+
if name.startswith("TOKEN_")}
31+
# Backward-compatibility alias: some test data may use PSEUDO_ROOT
32+
# to mean FAKE_ROOT
3133
kind_map.setdefault("TOKEN_PSEUDO_ROOT", tokmod.TOKEN_FAKE_ROOT)
3234

3335
def to_token(obj: Dict[str, Any]) -> Token:
3436
try:
3537
kind_value = kind_map[obj["kind"]]
3638
except KeyError as e:
37-
raise KeyError(f"Unknown token kind in test_lex.json: {obj.get('kind')}\nKnown kinds: "
38-
f"{sorted(kind_map.keys())}") from e
39+
raise KeyError(
40+
f"Unknown token kind in test_lex.json: {obj.get('kind')}\n"
41+
f"Known kinds: "
42+
f"{sorted(kind_map.keys())}") from e
3943
return Token(
4044
kind=kind_value,
4145
value=obj["value"],

0 commit comments

Comments
 (0)