Skip to content

Commit

Permalink
run pyupgrade --py39-plus on the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
youtux committed Oct 15, 2024
1 parent cfdfce6 commit ac46cd0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
6 changes: 3 additions & 3 deletions python/gherkin/ast_builder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import TypedDict, cast, TypeVar, Union, List
from typing import TypedDict, cast, TypeVar, Union

from .ast_node import AstNode
from .errors import AstBuilderException
Expand Down Expand Up @@ -140,7 +140,7 @@ def get_description(node: AstNode) -> str:

@staticmethod
def get_steps(node: AstNode) -> list[Step]:
return cast(List[Step], node.get_items("Step"))
return cast(list[Step], node.get_items("Step"))

def transform_node(
self, node: AstNode
Expand Down Expand Up @@ -247,7 +247,7 @@ def transform_node(
examples_line = examples_node.get_token("ExamplesLine")
description = self.get_description(examples_node)
examples_table_rows = cast(
List[TableRow], examples_node.get_single("ExamplesTable")
list[TableRow], examples_node.get_single("ExamplesTable")
)
table_header = examples_table_rows[0] if examples_table_rows else None
table_body = examples_table_rows[1:] if examples_table_rows else []
Expand Down
22 changes: 11 additions & 11 deletions python/gherkin/dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
DialectSpec = TypedDict(
"DialectSpec",
{
"and": List[str],
"background": List[str],
"but": List[str],
"examples": List[str],
"feature": List[str],
"given": List[str],
"rule": List[str],
"scenario": List[str],
"scenarioOutline": List[str],
"then": List[str],
"when": List[str],
"and": list[str],
"background": list[str],
"but": list[str],
"examples": list[str],
"feature": list[str],
"given": list[str],
"rule": list[str],
"scenario": list[str],
"scenarioOutline": list[str],
"then": list[str],
"when": list[str],
},
)

Expand Down
3 changes: 0 additions & 3 deletions python/test/count_symbols_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# coding=utf-8


def test_count_length_of_astral_point_symbols_correctly():
string = "\U0001f63b"
assert 1 == len(string)
Expand Down
1 change: 0 additions & 1 deletion python/test/gherkin_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding=utf-8
from gherkin.token_scanner import TokenScanner
from gherkin.token_matcher import TokenMatcher
from gherkin.parser import Parser
Expand Down
1 change: 0 additions & 1 deletion python/test/pickles_test/compiler_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding=utf-8
import json
import textwrap

Expand Down

0 comments on commit ac46cd0

Please sign in to comment.