Skip to content

Mypy completely ignores some test files #1346

@karlb

Description

@karlb

This is because it only recurses into directories with an __init__.py, which is not true for all test directories. See python/mypy#6385 (comment)

Example

(venv-contracts) karl@t480karl:~/raiden-contracts (master)$ mypy raiden_contracts/tests/  # no errors found
(venv-contracts) karl@t480karl:~/raiden-contracts (master)$ mypy raiden_contracts/tests/property/
raiden_contracts/tests/property/strategies.py:16: error: Function is missing a type annotation
raiden_contracts/tests/property/strategies.py:40: error: Function is missing a type annotation
raiden_contracts/tests/property/strategies.py:55: error: Function is missing a return type annotation
raiden_contracts/tests/property/strategies.py:69: error: Function is missing a return type annotation
raiden_contracts/tests/property/strategies.py:77: error: Function is missing a type annotation
raiden_contracts/tests/property/test_tokennetwork.py:42: error: Function is missing a type annotation
raiden_contracts/tests/property/test_tokennetwork.py:60: error: Function is missing a return type annotation
raiden_contracts/tests/property/test_tokennetwork.py:60: note: Use "-> None" if function does not return a value
raiden_contracts/tests/property/test_tokennetwork.py:63: error: Need type annotation for 'log' (hint: "log: List[<type>] = ...")                                                                                                                             
raiden_contracts/tests/property/test_tokennetwork.py:74: error: Too few arguments for "deploy_custom_token"
raiden_contracts/tests/property/test_tokennetwork.py:75: error: Too few arguments for "deploy_custom_token"
raiden_contracts/tests/property/test_tokennetwork.py:88: error: Need type annotation for 'addresses' (hint: "addresses: List[<type>] = ...")                                                                                                                 
raiden_contracts/tests/property/test_tokennetwork.py:109: error: Argument 2 to "deploy_contract" has incompatible type "str"; expected "ContractManager"                                                                                                     
raiden_contracts/tests/property/test_tokennetwork.py:113: error: Argument 2 to "deploy_contract" has incompatible type "str"; expected "ContractManager"                                                                                                     
raiden_contracts/tests/property/test_tokennetwork.py:129: error: Too few arguments for "get_token_network"
raiden_contracts/tests/property/test_tokennetwork.py:142: error: Function is missing a return type annotation
raiden_contracts/tests/property/test_tokennetwork.py:177: error: Function is missing a type annotation
raiden_contracts/tests/property/test_tokennetwork.py:201: error: Function is missing a type annotation
raiden_contracts/tests/property/test_tokennetwork.py:204: error: Function is missing a type annotation
raiden_contracts/tests/property/test_tokennetwork.py:253: error: Function is missing a type annotation
raiden_contracts/tests/property/test_tokennetwork.py:344: error: Function is missing a type annotation
raiden_contracts/tests/property/test_tokennetwork.py:482: error: Function is missing a return type annotation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions