Skip to content

Commit

Permalink
Fix `tests/test_extract/test_cli_extractor.py:313: DeprecationWarning…
Browse files Browse the repository at this point in the history
…: Name.__init__ missing 1 required positional argument: 'id'. This will become an error in Python 3.15.`
  • Loading branch information
andrew000 committed Oct 27, 2024
1 parent 16561e8 commit 5ebc579
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_extract/test_cli_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def test_i18n_matcher_skips_call_with_no_args(setup_environment: tuple[Path, Pat
code_path, output_path = setup_environment
matcher = I18nMatcher(code_path)

node = ast.Call(func=ast.Attribute(value=ast.Name(id="i18n"), attr="get"), args=[])
node = ast.Call(func=ast.Attribute(value=ast.Name(id="i18n"), attr="get"), args=[], keywords=[])
matcher.visit_Call(node)

assert len(matcher.fluent_keys) == 0
Expand All @@ -310,7 +310,11 @@ def test_generic_visit_called_on_else_block(setup_environment: tuple[Path, Path]
code_path, output_path = setup_environment
matcher = I18nMatcher(code_path)

node = ast.Call(func=ast.Attribute(value=ast.Name(id="i18n"), attr="get"), args=[ast.Name()])
node = ast.Call(
func=ast.Attribute(value=ast.Name(id="i18n"), attr="get"),
args=[ast.Name(id="i18n")],
keywords=[],
)

with patch.object(matcher, "generic_visit", wraps=matcher.generic_visit) as mock_generic_visit:
matcher.visit_Call(node)
Expand Down

0 comments on commit 5ebc579

Please sign in to comment.