Skip to content

chore: fix mypy union assignment issues

Tan Le requested to merge fix-type-test-mock into main

What does this merge request do and why?

mypy does not know which type is used in a union return. This change ensures we explicit assert the type and remove the linting errors (union-attr).

How to set up and validate locally

  1. Observe the errors by running the follow command.
    poetry run mypy tests/code_suggestions/models/test_mock.py
  2. Check out to this merge request's branch.
  3. Confirm the errors no longer shows.

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
Edited by Tan Le

Merge request reports