Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
You need to sign in or sign up before continuing.
  • linux
  • tools
  • testing
  • kunit
  • kunit_kernel.py
Find file BlameHistoryPermalink
  • Daniel Latypov's avatar
    kunit: tool: surface and address more typing issues · 09641f7c
    Daniel Latypov authored Jan 14, 2021
    The authors of this tool were more familiar with a different
    type-checker, https://github.com/google/pytype.
    
    That's open source, but mypy seems more prevalent (and runs faster).
    And unlike pytype, mypy doesn't try to infer types so it doesn't check
    unanotated functions.
    
    So annotate ~all functions in kunit tool to increase type-checking
    coverage.
    Note: per https://www.python.org/dev/peps/pep-0484/
    
    , `__init__()` should
    be annotated as `-> None`.
    
    Doing so makes mypy discover a number of new violations.
    Exclude main() since we reuse `request` for the different types of
    requests, which mypy isn't happy about.
    
    This commit fixes all but one error, where `TestSuite.status` might be
    None.
    
    Signed-off-by: default avatarDaniel Latypov <dlatypov@google.com>
    Reviewed-by: default avatarDavid Gow <davidgow@google.com>
    Tested-by: default avatarBrendan Higgins <brendanhiggins@google.com>
    Acked-by: default avatarBrendan Higgins <brendanhiggins@google.com>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    09641f7c
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7