Skip to content

Conversation

@asnare
Copy link
Contributor

@asnare asnare commented May 15, 2025

This PR implements add type hints for existing unit tests, resolving warnings during project linting. The warnings were during mypy processing, because we had type hints within the test body but the test function itself had none:

tests/unit/test_installation.py:459: note: By default the bodies of untyped functions are not checked, consider using --check-untype
d-defs  [annotation-unchecked]                                                                                                      
tests/unit/test_installation.py:471: note: By default the bodies of untyped functions are not checked, consider using --check-untype
d-defs  [annotation-unchecked]                                                                                                      
tests/unit/test_installation.py:483: note: By default the bodies of untyped functions are not checked, consider using --check-untype
d-defs  [annotation-unchecked]                                    
tests/unit/test_installation.py:495: note: By default the bodies of untyped functions are not checked, consider using --check-untype
d-defs  [annotation-unchecked]                                    
tests/unit/test_installation.py:507: note: By default the bodies of untyped functions are not checked, consider using --check-untype
d-defs  [annotation-unchecked]                                                                                                      
tests/unit/test_installation.py:519: note: By default the bodies of untyped functions are not checked, consider using --check-untype
d-defs  [annotation-unchecked]                                    
tests/unit/test_installation.py:531: note: By default the bodies of untyped functions are not checked, consider using --check-untype
d-defs  [annotation-unchecked]                                                                                                      
tests/unit/test_installation.py:543: note: By default the bodies of untyped functions are not checked, consider using --check-untype
d-defs  [annotation-unchecked]                                    

(All resolved.)

This resolves some warnings when linting the project.
@asnare asnare requested a review from sundarshankar89 May 15, 2025 10:45
@asnare asnare self-assigned this May 15, 2025
@asnare asnare requested a review from nfx as a code owner May 15, 2025 10:45
@asnare asnare added the internal do not show this PR in changelog label May 15, 2025
@github-actions
Copy link

✅ 40/40 passed, 2 skipped, 2m7s total

Running from acceptance #263

@asnare asnare requested review from a team and removed request for nfx May 15, 2025 10:53
Copy link
Collaborator

@sundarshankar89 sundarshankar89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@asnare asnare merged commit 3b8e981 into main May 15, 2025
11 checks passed
@asnare asnare deleted the type-hint-tests branch May 15, 2025 17:05
ericvergnaud added a commit that referenced this pull request May 15, 2025
* main:
  Fix argument interpolation in colorised logs (#233)
  Ensure the non-colorized logs also include timestamps with second-lev… (#235)
  Test coverage for the customised logger setup (#232)
  Type hints for existing installation tests (#231)

# Conflicts:
#	tests/unit/test_installation.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal do not show this PR in changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants