[ty] Preserve gradual behavior for explicit Any subclasses#26034
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 94.37%. The percentage of expected errors that received a diagnostic held steady at 89.00%. The number of fully passing files held steady at 94/134. |
Memory usage reportSummary
Significant changesClick to expand detailed breakdownprefect
sphinx
trio
flake8
|
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-assignment |
0 | 224 | 0 |
unresolved-attribute |
0 | 115 | 1 |
unused-type-ignore-comment |
19 | 0 | 0 |
invalid-parameter-default |
0 | 5 | 0 |
invalid-argument-type |
0 | 3 | 0 |
| Total | 19 | 347 | 1 |
Showing a random sample of 310 of 367 changes. See the HTML report for the full diff.
Raw diff sample (310 of 367 changes)
aiohttp (https://github.com/aio-libs/aiohttp)
- aiohttp/test_utils.py:626:15 error[invalid-assignment] Object of type `MagicMock` is not assignable to `Application | None`
alerta (https://github.com/alerta/alerta)
- tests/plugins/test_reject.py:27:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `get_config` of type `def get_config(key, default=None, type=None, **kwargs) -> Unknown`
apprise (https://github.com/caronc/apprise)
- tests/test_plugin_rocket_chat.py:423:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `login` of type `def login(self) -> Unknown`
- tests/test_utils_socket.py:445:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:498:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `send` of type `def send(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:600:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `bind` of type `def bind(self, *_args, **_kwargs) -> None`
- tests/test_utils_socket.py:605:5 error[unresolved-attribute] Object of type `bound method _DummySocket.bind(...) -> None` has no attribute `assert_called_once`
- tests/test_utils_socket.py:612:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `settimeout` of type `def settimeout(self, value) -> Unknown`
- tests/test_utils_socket.py:619:12 error[unresolved-attribute] Object of type `bound method _DummySocket.settimeout(value) -> Unknown` has no attribute `call_args_list`
- tests/test_utils_socket.py:783:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `send` of type `def send(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:810:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:813:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:847:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:867:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:869:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:986:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:1010:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:1023:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:1027:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:1049:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:1057:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
bandersnatch (https://github.com/pypa/bandersnatch)
+ src/bandersnatch/tests/test_sync.py:17:70 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:236:67 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:311:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:331:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:367:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:411:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:436:62 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:510:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:547:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- src/bandersnatch/tests/test_package.py:30:12 error[unresolved-attribute] Object of type `bound method Master.get_package_metadata(package_name: str, serial: int = 0) -> CoroutineType[Any, Any, Any]` has no attribute `await_count`
- src/bandersnatch/tests/test_package.py:59:12 error[unresolved-attribute] Object of type `bound method Master.get_package_metadata(package_name: str, serial: int = 0) -> CoroutineType[Any, Any, Any]` has no attribute `await_count`
+ src/bandersnatch/tests/test_package.py:25:69 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_package.py:39:47 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_package.py:53:72 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
cki-lib (https://gitlab.com/cki-project/cki-lib)
- tests/test_cronjob.py:38:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `run` of type `def run(self, *, last_run_datetime=None) -> Unknown`
- tests/test_cronjob.py:42:25 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `called`
- tests/test_cronjob.py:80:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `run` of type `def run(self, *, last_run_datetime=None) -> Unknown`
- tests/test_cronjob.py:85:25 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `called`
- tests/test_cronjob.py:86:9 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `assert_called_with`
- tests/test_cronjob.py:92:9 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `reset_mock`
- tests/test_cronjob.py:95:26 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `called`
- tests/test_cronjob.py:110:29 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `called`
- tests/test_cronjob.py:111:13 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `assert_called_with`
- tests/test_cronjob.py:115:13 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `reset_mock`
- tests/test_cronjob.py:118:29 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `called`
- tests/test_cronjob.py:119:13 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `assert_called_with`
- tests/test_cronjob.py:125:13 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `reset_mock`
- tests/test_cronjob.py:128:29 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `called`
- tests/test_cronjob.py:129:13 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `assert_called_with`
- tests/test_cronjob.py:140:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_run` of type `def _run(self, last_run_datetime) -> Unknown`
- tests/test_cronjob.py:184:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_run` of type `def _run(self, last_run_datetime) -> Unknown`
- tests/test_cronjob.py:246:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_run` of type `def _run(self, last_run_datetime) -> Unknown`
- tests/test_psql.py:98:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_execute` of type `def _execute(self, query, *args) -> Unknown`
- tests/test_psql.py:99:9 error[unresolved-attribute] Unresolved attribute `side_effect` on type `bound method PSQLHandler._execute(query, *args) -> Unknown`
- tests/test_psql.py:102:29 error[unresolved-attribute] Object of type `bound method PSQLHandler._execute(query, *args) -> Unknown` has no attribute `call_count`
cloud-init (https://github.com/canonical/cloud-init)
- tests/unittests/sources/test_azure.py:1262:13 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `get_tmp_exec_path` on type `(Unknown & ~str) | Distro`
- tests/unittests/sources/test_openstack.py:849:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_read_ec2_metadata` of type `def _read_ec2_metadata(self) -> Unknown`
- tests/unittests/test_stages.py:98:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `is_new_instance` of type `def is_new_instance(self) -> Unknown`
dd-trace-py (https://github.com/DataDog/dd-trace-py)
- tests/appsec/appsec/api_security/test_api_security_manager.py:32:13 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_should_collect_schema` of type `def _should_collect_schema(self, env: ASM_Environment, priority: int | float) -> bool | None`
- tests/ci_visibility/test_ci_visibility.py:1827:13 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_is_gzip_supported_by_agent` of type `def _is_gzip_supported_by_agent(self) -> bool`
- tests/ci_visibility/test_ci_visibility.py:1845:13 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_is_gzip_supported_by_agent` of type `def _is_gzip_supported_by_agent(self) -> bool`
- tests/ci_visibility/test_ci_visibility.py:1851:13 error[unresolved-attribute] Object of type `bound method CIVisibility._is_gzip_supported_by_agent() -> bool` has no attribute `assert_called_once`
dragonchain (https://github.com/dragonchain/dragonchain)
- dragonchain/lib/dto/btc_utest.py:51:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/btc_utest.py:53:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/btc_utest.py:56:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/btc_utest.py:58:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/btc_utest.py:61:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:62:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `sign_transaction` of type `def sign_transaction(self, raw_transaction: dict[str, Any]) -> str`
- dragonchain/lib/dto/btc_utest.py:66:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:67:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork.sign_transaction(raw_transaction: dict[str, Any]) -> str` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:70:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_utxos` of type `def _get_utxos(self) -> list[Unknown]`
- dragonchain/lib/dto/btc_utest.py:77:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:81:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:84:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:87:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:90:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_calculate_transaction_fee` of type `def _calculate_transaction_fee(self) -> int`
- dragonchain/lib/dto/btc_utest.py:93:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._calculate_transaction_fee() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/btc_utest.py:105:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:111:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:114:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:117:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:120:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:122:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:128:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:131:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:138:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:140:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/job_processor/contract_job_utest.py:263:13 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `set_state` of type `def set_state(self, state: str | ContractState, msg: str = "") -> None`
- dragonchain/job_processor/contract_job_utest.py:264:13 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:274:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `docker_login_if_necessary` of type `def docker_login_if_necessary(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:280:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `pull_image` of type `def pull_image(self, image_name: str) -> Unknown`
- dragonchain/job_processor/contract_job_utest.py:281:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `create_dockerfile` of type `def create_dockerfile(self) -> str`
- dragonchain/job_processor/contract_job_utest.py:286:9 error[unresolved-attribute] Object of type `bound method ContractJob.pull_image(image_name: str) -> Unknown` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:287:9 error[unresolved-attribute] Object of type `bound method ContractJob.create_dockerfile() -> str` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:307:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `set_state` of type `def set_state(self, state: str | ContractState, msg: str = "") -> None`
- dragonchain/job_processor/contract_job_utest.py:308:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:312:9 error[unresolved-attribute] Object of type `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:330:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `set_state` of type `def set_state(self, state: str | ContractState, msg: str = "") -> None`
- dragonchain/job_processor/contract_job_utest.py:331:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:334:9 error[unresolved-attribute] Object of type `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:356:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `set_state` of type `def set_state(self, state: str | ContractState, msg: str = "") -> None`
- dragonchain/job_processor/contract_job_utest.py:361:9 error[unresolved-attribute] Object of type `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:375:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `set_state` of type `def set_state(self, state: str | ContractState, msg: str = "") -> None`
- dragonchain/job_processor/contract_job_utest.py:381:9 error[unresolved-attribute] Object of type `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:416:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `set_state` of type `def set_state(self, state: str | ContractState, msg: str = "") -> None`
- dragonchain/job_processor/contract_job_utest.py:417:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:435:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:436:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `new_from_build_task` of type `def new_from_build_task(data: Mapping[str, Any]) -> SmartContractModel`
- dragonchain/job_processor/contract_job_utest.py:438:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `create` of type `def create(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:440:9 error[unresolved-attribute] Function `create` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:445:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `new_from_build_task` of type `def new_from_build_task(data: Mapping[str, Any]) -> SmartContractModel`
- dragonchain/job_processor/contract_job_utest.py:453:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `schedule_contract` of type `def schedule_contract(self, action: SchedulerActions = SchedulerActions.CREATE) -> None`
- dragonchain/job_processor/contract_job_utest.py:454:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `build_contract_image` of type `def build_contract_image(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:455:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `deploy_to_openfaas` of type `def deploy_to_openfaas(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:456:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `create_openfaas_secrets` of type `def create_openfaas_secrets(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:458:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:459:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `populate_api_keys` of type `def populate_api_keys(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:465:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `deploy_to_openfaas` of type `def deploy_to_openfaas(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:466:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `schedule_contract` of type `def schedule_contract(self, action: SchedulerActions = SchedulerActions.CREATE) -> None`
- dragonchain/job_processor/contract_job_utest.py:468:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:469:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `create_openfaas_secrets` of type `def create_openfaas_secrets(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:484:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_contract_by_txn_type` of type `def get_contract_by_txn_type(txn_type: str) -> SmartContractModel`
- dragonchain/job_processor/contract_job_utest.py:485:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `new_from_build_task` of type `def new_from_build_task(data: Mapping[str, Any]) -> SmartContractModel`
- dragonchain/job_processor/contract_job_utest.py:486:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `create_dockerfile` of type `def create_dockerfile(self) -> str`
- dragonchain/job_processor/contract_job_utest.py:487:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `create_openfaas_secrets` of type `def create_openfaas_secrets(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:488:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `delete_contract_image` of type `def delete_contract_image(self, image_digest: str) -> None`
- dragonchain/job_processor/contract_job_utest.py:489:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `deploy_to_openfaas` of type `def deploy_to_openfaas(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:490:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `pull_image` of type `def pull_image(self, image_name: str) -> Unknown`
- dragonchain/job_processor/contract_job_utest.py:491:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `schedule_contract` of type `def schedule_contract(self, action: SchedulerActions = SchedulerActions.CREATE) -> None`
- dragonchain/job_processor/contract_job_utest.py:508:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `delete_openfaas_secrets` of type `def delete_openfaas_secrets(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:509:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `delete_openfaas_function` of type `def delete_openfaas_function(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:510:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `delete_contract_data` of type `def delete_contract_data(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:511:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `delete_contract_image` of type `def delete_contract_image(self, image_digest: str) -> None`
- dragonchain/job_processor/contract_job_utest.py:512:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `unschedule_contract` of type `def unschedule_contract(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:513:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:515:9 error[unresolved-attribute] Object of type `bound method ContractJob.delete_openfaas_secrets() -> None` has no attribute `assert_called_once`
- dragonchain/job_processor/contract_job_utest.py:516:9 error[unresolved-attribute] Object of type `bound method ContractJob.delete_openfaas_function() -> None` has no attribute `assert_called_once`
- dragonchain/job_processor/contract_job_utest.py:517:9 error[unresolved-attribute] Object of type `bound method ContractJob.delete_contract_image(image_digest: str) -> None` has no attribute `assert_called_once`
- dragonchain/job_processor/contract_job_utest.py:518:9 error[unresolved-attribute] Object of type `bound method ContractJob.delete_contract_data() -> None` has no attribute `assert_called_once`
- dragonchain/job_processor/contract_job_utest.py:519:9 error[unresolved-attribute] Object of type `bound method ContractJob.unschedule_contract() -> None` has no attribute `assert_called_once`
- dragonchain/job_processor/contract_job_utest.py:269:13 error[unresolved-attribute] Object of type `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` has no attribute `assert_called_once`
+ dragonchain/job_processor/contract_job_utest.py:269:13 error[unresolved-attribute] Attribute `assert_called_once` is not defined on `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` in union `(bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None) | MagicMock`
- dragonchain/lib/database/redisearch_utest.py:70:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:73:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_called_once_with`
- dragonchain/lib/database/redisearch_utest.py:85:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:93:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:103:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:105:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_called_once_with`
- dragonchain/lib/database/redisearch_utest.py:110:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:113:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_called_once_with`
- dragonchain/lib/database/redisearch_utest.py:130:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:135:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:142:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:175:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:177:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_called_once_with`
- dragonchain/lib/database/redisearch_utest.py:193:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_any_call`
- dragonchain/lib/database/redisearch_utest.py:195:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_any_call`
- dragonchain/lib/database/redisearch_utest.py:196:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_any_call`
- dragonchain/lib/database/redisearch_utest.py:197:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_any_call`
- dragonchain/lib/dto/bnb_utest.py:73:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/bnb_utest.py:75:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/bnb_utest.py:78:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/bnb_utest.py:80:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/bnb_utest.py:84:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_fetch_account` of type `def _fetch_account(self) -> Unknown`
- dragonchain/lib/dto/bnb_utest.py:97:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._fetch_account() -> Unknown` has no attribute `assert_called_once`
- dragonchain/lib/dto/bnb_utest.py:109:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_fetch_account` of type `def _fetch_account(self) -> Unknown`
- dragonchain/lib/dto/bnb_utest.py:118:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_build_transaction_msg` of type `def _build_transaction_msg(self, raw_transaction: dict[str, Any]) -> dict[Unknown, Unknown]`
- dragonchain/lib/dto/bnb_utest.py:123:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_rpc` of type `def _call_node_rpc(self, method: str, params: dict[str, Any]) -> Any`
- dragonchain/lib/dto/bnb_utest.py:126:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_rpc(method: str, params: dict[str, Any]) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:131:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_rpc` of type `def _call_node_rpc(self, method: str, params: dict[str, Any]) -> Any`
- dragonchain/lib/dto/bnb_utest.py:134:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_rpc(method: str, params: dict[str, Any]) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:140:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:151:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_api(path: str) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:156:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:164:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:170:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/bnb_utest.py:173:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_rpc` of type `def _call_node_rpc(self, method: str, params: dict[str, Any]) -> Any`
- dragonchain/lib/dto/bnb_utest.py:176:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_rpc(method: str, params: dict[str, Any]) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:177:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/bnb_utest.py:180:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/bnb_utest.py:183:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_rpc` of type `def _call_node_rpc(self, method: str, params: dict[str, Any]) -> Any`
- dragonchain/lib/dto/bnb_utest.py:186:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_rpc(method: str, params: dict[str, Any]) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:187:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/bnb_utest.py:194:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_rpc(method: str, params: dict[str, Any]) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:322:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:325:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_api(path: str) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:331:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:333:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_api(path: str) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:338:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_rpc` of type `def _call_node_rpc(self, method: str, params: dict[str, Any]) -> Any`
- dragonchain/lib/dto/bnb_utest.py:339:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:341:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_rpc(method: str, params: dict[str, Any]) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:342:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_api(path: str) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:347:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_rpc` of type `def _call_node_rpc(self, method: str, params: dict[str, Any]) -> Any`
- dragonchain/lib/dto/bnb_utest.py:349:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/eth_utest.py:51:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `sign_transaction` of type `def sign_transaction(self, raw_transaction: dict[str, Any]) -> str`
- dragonchain/lib/dto/eth_utest.py:60:9 error[unresolved-attribute] Object of type `bound method EthereumNetwork.sign_transaction(raw_transaction: dict[str, Any]) -> str` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/eth_utest.py:72:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/eth_utest.py:74:9 error[unresolved-attribute] Object of type `bound method EthereumNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/eth_utest.py:77:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/eth_utest.py:79:9 error[unresolved-attribute] Object of type `bound method EthereumNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/eth_utest.py:88:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_calculate_transaction_fee` of type `def _calculate_transaction_fee(self) -> int`
- dragonchain/lib/dto/eth_utest.py:91:9 error[unresolved-attribute] Object of type `bound method EthereumNetwork._calculate_transaction_fee() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/eth_utest.py:115:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/eth_utest.py:120:9 error[unresolved-attribute] Object of type `bound method EthereumNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/eth_utest.py:123:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/eth_utest.py:128:9 error[unresolved-attribute] Object of type `bound method EthereumNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/eth_utest.py:136:9 error[unresolved-attribute] Object of type `bound method EthereumNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/interfaces/storage_utest.py:44:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `cache_get` of type `def cache_get(key: str, service_name: str = "storage") -> bytes | None`
- dragonchain/lib/interfaces/storage_utest.py:45:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `cache_put` of type `def cache_put(key: str, value: str | bytes, cache_expire: int | None = None, service_name: str = "storage") -> bool`
- dragonchain/lib/interfaces/storage_utest.py:46:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `cache_delete` of type `def cache_delete(key: str, service_name: str = "storage") -> int`
- dragonchain/lib/interfaces/storage_utest.py:58:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:62:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:64:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `cache_put` of type `def cache_put(key: str, value: str | bytes, cache_expire: int | None = None, service_name: str = "storage") -> bool`
- dragonchain/lib/interfaces/storage_utest.py:66:9 error[unresolved-attribute] Function `cache_get` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:67:9 error[unresolved-attribute] Function `cache_put` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:70:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:78:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `put` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:90:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `delete` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:98:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `list_objects` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:100:9 error[unresolved-attribute] Object of type `(def list_objects(location: str, prefix: str) -> list[str]) | (def list_objects(location: str, prefix: str) -> list[str])` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:103:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `list_objects` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:111:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `does_superkey_exist` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:123:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `put` of type `def put(key: str, value: bytes, cache_expire: int | None = None, should_cache: bool = True) -> None`
- dragonchain/lib/interfaces/storage_utest.py:138:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `list_objects` of type `def list_objects(prefix: str) -> list[str]`
- dragonchain/lib/interfaces/storage_utest.py:140:9 error[unresolved-attribute] Function `list_objects` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:144:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `delete` of type `def delete(key: str) -> None`
- dragonchain/lib/interfaces/storage_utest.py:146:9 error[unresolved-attribute] Function `delete` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:149:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `list_objects` of type `def list_objects(prefix: str) -> list[str]`
- dragonchain/lib/interfaces/storage_utest.py:154:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `list_objects` of type `def list_objects(prefix: str) -> list[str]`
- dragonchain/lib/interfaces/storage_utest.py:158:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `select_transaction` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:160:9 error[unresolved-attribute] Object of type `(def select_transaction(location: str, block_id: str, txn_id: str) -> dict[Unknown, Unknown]) | (def select_transaction(location: str, block_id: str, txn_id: str) -> dict[Unknown, Unknown])` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:163:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `select_transaction` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:164:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `cache_get` of type `def cache_get(key: str, service_name: str = "storage") -> bytes | None`
- dragonchain/lib/interfaces/storage_utest.py:169:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `select_transaction` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:170:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `cache_get` of type `def cache_get(key: str, service_name: str = "storage") -> bytes | None`
- dragonchain/lib/interfaces/storage_utest.py:178:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `select_transaction` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:183:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `select_transaction` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:187:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `select_transaction` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:192:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `put` of type `def put(key: str, value: bytes, cache_expire: int | None = None, should_cache: bool = True) -> None`
- dragonchain/lib/interfaces/storage_utest.py:194:9 error[unresolved-attribute] Function `put` has no attribute `assert_called_once_with`
- dragonchain/transaction_processor/level_5_actions_utest.py:238:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `publish_l5_hash_to_public_network` of type `def publish_l5_hash_to_public_network(self, l5_block_hash: str) -> str`
- dragonchain/transaction_processor/level_5_actions_utest.py:466:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `check_balance` of type `def check_balance(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:467:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_transaction_fee_estimate` of type `def get_transaction_fee_estimate(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:470:9 error[unresolved-attribute] Object of type `bound method InterchainModel.check_balance() -> int` has no attribute `assert_called_once`
- dragonchain/transaction_processor/level_5_actions_utest.py:481:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `check_balance` of type `def check_balance(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:482:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_transaction_fee_estimate` of type `def get_transaction_fee_estimate(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:485:9 error[unresolved-attribute] Object of type `bound method InterchainModel.check_balance() -> int` has no attribute `assert_called_once`
- dragonchain/transaction_processor/level_5_actions_utest.py:493:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_transaction_fee_estimate` of type `def get_transaction_fee_estimate(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:496:9 error[unresolved-attribute] Object of type `bound method InterchainModel.get_transaction_fee_estimate() -> int` has no attribute `assert_called_once`
- dragonchain/transaction_processor/level_5_actions_utest.py:507:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_transaction_fee_estimate` of type `def get_transaction_fee_estimate(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:510:9 error[unresolved-attribute] Object of type `bound method InterchainModel.get_transaction_fee_estimate() -> int` has no attribute `assert_called_once`
- dragonchain/transaction_processor/level_5_actions_utest.py:519:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_transaction_fee_estimate` of type `def get_transaction_fee_estimate(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:522:9 error[unresolved-attribute] Object of type `bound method InterchainModel.get_transaction_fee_estimate() -> int` has no attribute `assert_called_once`
- dragonchain/webserver/lib/verifications_dao_utest.py:106:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/webserver/lib/verifications_dao_utest.py:132:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
egglog-python (https://github.com/egraphs-good/egglog-python)
- python/tests/test_high_level.py:1334:9 error[unresolved-attribute] Function `my_cost_model` has no attribute `assert_any_call`
- python/tests/test_high_level.py:1335:9 error[unresolved-attribute] Function `my_cost_model` has no attribute `assert_any_call`
- python/tests/test_high_level.py:1336:9 error[unresolved-attribute] Function `my_cost_model` has no attribute `assert_any_call`
- python/tests/test_high_level.py:1337:9 error[unresolved-attribute] Function `my_cost_model` has no attribute `assert_any_call`
ignite (https://github.com/pytorch/ignite)
- tests/ignite/metrics/test_metric.py:810:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `compute` of type `def compute(self) -> Unknown`
- tests/ignite/metrics/test_metric.py:818:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `compute` of type `def compute(self) -> Unknown`
manticore (https://github.com/trailofbits/manticore)
- tests/native/test_memory.py:1875:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `sys` of type `<module 'sys'>`
- tests/native/test_memory.py:1882:9 error[unresolved-attribute] Module `sys` has no member `configure_mock`
- tests/native/test_memory.py:1886:9 error[unresolved-attribute] Module `sys` has no member `configure_mock`
- tests/native/test_memory.py:1890:9 error[unresolved-attribute] Module `sys` has no member `configure_mock`
mitmproxy (https://github.com/mitmproxy/mitmproxy)
- test/mitmproxy/tools/console/test_flowview.py:92:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_content_view` of type `_lru_cache_wrapper[tuple[str, list[Unknown]]]`
- test/mitmproxy/tools/console/test_flowview.py:94:5 error[unresolved-attribute] Object of type `_lru_cache_wrapper[tuple[str, list[Unknown]]]` has no attribute `assert_called_with`
mkdocs (https://github.com/mkdocs/mkdocs)
- mkdocs/tests/structure/file_tests.py:660:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `is_modified` of type `def is_modified(self) -> bool`
- mkdocs/tests/structure/file_tests.py:671:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `is_modified` of type `def is_modified(self) -> bool`
- mkdocs/tests/structure/file_tests.py:682:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `is_modified` of type `def is_modified(self) -> bool`
optuna (https://github.com/optuna/optuna)
- tests/study_tests/test_study.py:1707:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_all_trials` of type `def get_all_trials(self, study_id: int, deepcopy: bool = True, states: Container[TrialState] | None = None) -> list[FrozenTrial]`
prefect (https://github.com/PrefectHQ/prefect)
- src/integrations/prefect-aws/tests/test_glue_job.py:120:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_client` of type `def _get_client(self) -> Any`
- src/integrations/prefect-aws/tests/test_glue_job.py:121:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_start_job` of type `def _start_job(self, client: Any) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:375:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:815:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:862:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:942:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:988:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1037:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1089:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1142:13 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1185:13 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1263:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1812:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_retrieve_task_definition` of type `def _retrieve_task_definition(self, logger: Logger, ecs_client: Unknown, task_definition: str) -> Unknown`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:2276:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:2312:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:2370:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-dbt/tests/core/test_orchestrator_per_node.py:1373:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_execute_per_node` of type `def _execute_per_node(self, waves, phases, largest_wave, full_refresh, macro_paths=None, freshness_results=None, all_nodes=None, adapter_type=None, project_name=None, target: str | None = None, extra_cli_args: list[str] | None = None, all_executable_nodes=None) -> Unknown`
rotki (https://github.com/rotki/rotki)
+ rotkehlchen/tests/exchanges/test_bitfinex.py:274:51 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/tests/exchanges/test_bitfinex.py:600:51 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/tests/exchanges/test_bitfinex.py:1479:51 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/tests/exchanges/test_bitfinex.py:1720:51 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/tests/unit/test_tokens.py:203:51 error[unresolved-attribute] Function `find_main_currency_prices` has no attribute `call_args_list`
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py:886:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_raw_predict` of type `def _raw_predict(self, X, n_threads=None) -> Unknown`
- sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py:912:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_raw_predict` of type `def _raw_predict(self, X, n_threads=None) -> Unknown`
scrapy (https://github.com/scrapy/scrapy)
- tests/test_downloadermiddleware_redirect.py:407:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_spider_middleware` of type `def get_spider_middleware[_T](self, cls: type[_T]) -> _T | None`
- tests/test_downloadermiddleware_redirect.py:421:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_spider_middleware` of type `def get_spider_middleware[_T](self, cls: type[_T]) -> _T | None`
- tests/test_downloadermiddleware_redirect.py:444:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_spider_middleware` of type `def get_spider_middleware[_T](self, cls: type[_T]) -> _T | None`
- tests/test_downloadermiddleware_redirect_metarefresh.py:144:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_spider_middleware` of type `def get_spider_middleware[_T](self, cls: type[_T]) -> _T | None`
- tests/test_downloadermiddleware_robotstxt.py:222:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `process_request_2` of type `def process_request_2(self, rp: RobotParser | None, request: Request) -> None`
- tests/test_downloadermiddleware_robotstxt.py:225:20 error[unresolved-attribute] Object of type `bound method RobotsTxtMiddleware.process_request_2(rp: RobotParser | None, request: Request) -> None` has no attribute `called`
- tests/test_downloadermiddleware_robotstxt.py:230:20 error[unresolved-attribute] Object of type `bound method RobotsTxtMiddleware.process_request_2(rp: RobotParser | None, request: Request) -> None` has no attribute `called`
- tests/test_downloadermiddleware_robotstxt.py:233:16 error[unresolved-attribute] Object of type `bound method RobotsTxtMiddleware.process_request_2(rp: RobotParser | None, request: Request) -> None` has no attribute `called`
steam.py (https://github.com/Gobot1234/steam.py)
- steam/protobufs/msg.py:97:32 error[invalid-parameter-default] Default value of type `MissingSentinel` is not assignable to annotated parameter type `EMsg`
- steam/protobufs/msg.py:145:32 error[invalid-parameter-default] Default value of type `MissingSentinel` is not assignable to annotated parameter type `EMsg`
- steam/protobufs/msg.py:309:9 error[invalid-parameter-default] Default value of type `MissingSentinel` is not assignable to annotated parameter type `AppID`
- steam/utils.py:565:29 error[invalid-parameter-default] Default value of type `MissingSentinel` is not assignable to annotated parameter type `_VT@ChainMap | _T@pop`
urllib3 (https://github.com/urllib3/urllib3)
- test/test_http2_connection.py:95:9 error[unresolved-attribute] Object of type `bound method HTTP2Connection.putheader(header: str | bytes, *values: str | bytes) -> None` has no attribute `assert_has_calls`
vision (https://github.com/pytorch/vision)
- test/datasets_utils.py:570:50 error[invalid-argument-type] Argument is incorrect: Expected `bool | None`, found `Mock`
- test/datasets_utils.py:570:50 error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `Mock`
Merging this PR will not alter performance
Comparing Footnotes
|
b2545fd to
ed023d7
Compare
| final: FinalClass = DynamicBase() # error: [invalid-assignment] | ||
| literal: Literal[1] = DynamicBase() # error: [invalid-assignment] | ||
|
|
||
| class FromUnknown(Unknown): ... |
There was a problem hiding this comment.
It doesn't hurt to test this case, and I think having it behave this way is fine, but we could decide to distinguish "inherits from the symbol Unknown" from "inherits from a name typed as Unknown", in the same way this PR distinguishes those two cases for Any. So I think this case is worthy of dedicated commentary (it does not fit the comment above), and it would be better if we test here using from somewhere import UnknownBase # error: [unresolved-import] and then class FromUnknownBase(UnknownBase): ... -- FromUnknownBase should also be assignable to a non-final class but not to a final one.
| class IndirectSubclass(DynamicBase): ... | ||
|
|
||
| reveal_type(DynamicBase()) # revealed: DynamicBase | ||
| ordinary: Arbitrary = IndirectSubclass() |
There was a problem hiding this comment.
Why not also test that assignment of IndirectSubclass to a final class type or a literal type is an error?
| y: Literal[1] = B() | ||
| ``` | ||
|
|
||
| A base expression whose inferred type is `Any` or `Unknown` does not count as explicitly inheriting |
There was a problem hiding this comment.
This prose does not describe the current state of the FromUnknown test below. It is inheriting from the symbol ty_extensions.Unknown, not from a base expression whose inferred type is Unknown.
| static_assert(not is_assignable_to(TypeOf[Bar], int)) | ||
| static_assert(not is_assignable_to(TypeOf[Baz], int)) | ||
| static_assert(not is_assignable_to(TypeOf[Mixed], int)) | ||
| static_assert(is_assignable_to(UnionDynamic, int)) |
There was a problem hiding this comment.
Seems kind of random/unintended that this line tests UnionDynamic rather than TypeOf[UnionDynamic], and thus has a different result from the rest of the block.
| class.explicit_bases(db).iter().any(|base| match base { | ||
| Type::SpecialForm(SpecialFormType::Any) => true, | ||
| Type::ClassLiteral(base) => inherits_from_any_inner(db, *base), | ||
| Type::GenericAlias(alias) => { |
There was a problem hiding this comment.
I don't think this arm is covered by any of the tests in this PR? Worth adding an explicit test for the generic alias case.
|
|
||
| /// Return whether `class` inherits from the `Any` special form. | ||
| #[salsa::tracked(cycle_initial=|_, _, _| false, heap_size=ruff_memory_usage::heap_size)] | ||
| fn inherits_from_any_inner<'db>(db: &'db dyn Db, class: ClassLiteral<'db>) -> bool { |
There was a problem hiding this comment.
The memory increase on this PR is significant. And it feels like this recursive walking of explicit bases is kind of redundant with existing work we already do in building the MRO. I wonder if you tested the comparative perf/memory impact of baking this one bit of additional metadata directly into our MRO representation, rather than making it a separate query that walks explicit bases recursively?
There was a problem hiding this comment.
I did briefly, but I think I should try it again -- I agree with you.
This reverts commit fb97655.
ed023d7 to
fe56ed9
Compare
67ecd9a to
d5e35a3
Compare
d5e35a3 to
bd6f428
Compare
7dc96c3 to
efe9f37
Compare
efe9f37 to
2d896b1
Compare
## Summary In #26034, we kept instances of classes that inherit from an explicit `Any` base nominal, then recovered `Any` assignability through a fallback after the ordinary relation check failed. That avoided increasing the size of `Type`, but required the relation checker to inspect the source class's MRO after the fact and discard any error context produced by the failed check. This records explicit-`Any` ancestry when we construct a nominal instance instead. Static classes compute the bit in the same tracked MRO walk that already classifies `TypedDict` instances, avoiding a second cached query; dynamic classes derive the same flags from their existing cached MRO. `ClassBase::Any` remains the compact MRO marker that distinguishes an explicit `Any` base from a base expression whose inferred type is `Any` or `Unknown`. Within `NominalInstanceInner::NonTuple`, a small `NominalInstanceClass` enum keeps ordinary `ClassType`s inline and stores only the uncommon marked case behind an interned handle. Nesting the marker inside the existing non-tuple payload means that `NominalInstanceInner` does not need a dedicated explicit-`Any` variant, and the release layout assertion continues to keep `Type` at 16 bytes. Behavior remains unchanged from #26034. With the marker available directly on nominal instances, the relation checker handles `Any` assignability in an ordinary match arm. This removes the failed-relation fallback and its error-context reset entirely. The CI memory report decreases total reported memory on all four projects: 5.06 kB on flake8, 23.64 kB on Trio, 132.16 kB on Sphinx, and 238.84 kB on Prefect.
Summary
In astral-sh/ty#1686 (comment), we decided the following:
As such, instances of classes that explicitly inherit from
Anynow retain their nominal type and precise declared members while remaining assignable to arbitrary types, includingFinalandLiteraltypes:Closes astral-sh/ty#1686.