Skip to content

Commit 1bfeef8

Browse files
authored
chore(codeql): finish suggest initiatives import cleanup
- Reuse the existing suggest_initiatives module alias for DismissalEvent tests - Remove the last mixed import style in that test module Tests: python3 -m pytest -q -p no:cacheprovider; ruff check src/ tests/
1 parent 3e70e8d commit 1bfeef8

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

tests/test_suggest_initiatives.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from src.llm_cost import BudgetExceededError
1313

1414
DismissedSuggestion = _si_mod.DismissedSuggestion
15+
DismissalEvent = _si_mod.DismissalEvent
1516
InitiativeSuggestion = _si_mod.InitiativeSuggestion
1617
accept_suggestion = _si_mod.accept_suggestion
1718
build_suggest_prompt = _si_mod.build_suggest_prompt
@@ -1877,8 +1878,6 @@ class TestDismissalEventDataclass:
18771878

18781879
def test_to_dict_returns_expected_keys(self):
18791880
"""to_dict() returns all five expected keys."""
1880-
from src.suggest_initiatives import DismissalEvent
1881-
18821881
e = DismissalEvent(
18831882
repo_name="FooRepo",
18841883
event_type="dismissed",
@@ -1893,8 +1892,6 @@ def test_to_dict_returns_expected_keys(self):
18931892

18941893
def test_round_trip_equality(self):
18951894
"""from_dict(to_dict(e)) == e."""
1896-
from src.suggest_initiatives import DismissalEvent
1897-
18981895
e = DismissalEvent(
18991896
repo_name="FooRepo",
19001897
event_type="undone",
@@ -1906,8 +1903,6 @@ def test_round_trip_equality(self):
19061903

19071904
def test_from_dict_missing_keys_defaults_safely(self):
19081905
"""from_dict with missing keys falls back to empty strings."""
1909-
from src.suggest_initiatives import DismissalEvent
1910-
19111906
e = DismissalEvent.from_dict({})
19121907
assert e.repo_name == ""
19131908
assert e.event_type == ""
@@ -1917,8 +1912,6 @@ def test_from_dict_missing_keys_defaults_safely(self):
19171912

19181913
def test_reason_defaults_to_empty_string(self):
19191914
"""reason field has a default of '' so it is optional."""
1920-
from src.suggest_initiatives import DismissalEvent
1921-
19221915
e = DismissalEvent(
19231916
repo_name="R",
19241917
event_type="dismissed",

0 commit comments

Comments
 (0)