Skip to content

Fix mypy type errors in SanitySuite helper methods#4270

Merged
LiliDeng merged 2 commits intoyzho/sanityfrom
copilot/sub-pr-4211-again
Feb 5, 2026
Merged

Fix mypy type errors in SanitySuite helper methods#4270
LiliDeng merged 2 commits intoyzho/sanityfrom
copilot/sub-pr-4211-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

Helper methods in SanitySuite were accessing self._log which doesn't exist on the TestSuite base class, causing 8 mypy type errors.

Changes

  • Added log parameter to helper methods: _is_marketplace_image() and _should_run_sanity() now accept the Logger instance passed from the test case
  • Replaced self._log with log parameter: All logging calls now use the explicitly passed logger
  • Fixed skip pattern: Replaced log.skip() (which doesn't exist on Logger) with raise SkippedException() following LISA's standard pattern
# Before
def _is_marketplace_image(self, node: Node) -> bool:
    self._log.debug("...")  # Error: _log doesn't exist

# After  
def _is_marketplace_image(self, log: "Logger", node: Node) -> bool:
    log.debug("...")  # Uses passed logger

All 526 source files now pass mypy strict type checking.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…methods

Co-authored-by: LiliDeng <10083705+LiliDeng@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI check errors in sanity verification Fix mypy type errors in SanitySuite helper methods Feb 5, 2026
Copilot AI requested a review from LiliDeng February 5, 2026 08:38
@LiliDeng LiliDeng marked this pull request as ready for review February 5, 2026 12:38
@LiliDeng LiliDeng merged commit bf25e3f into yzho/sanity Feb 5, 2026
27 checks passed
@LiliDeng LiliDeng deleted the copilot/sub-pr-4211-again branch February 5, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants