Repository navigation
Conversation
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-11-03 02:34:09.191807426 +0000
+++ /tmp/pyrefly_pr.txt 2026-11-03 02:33:56.419716710 +0000
@@ -5720,20 +5720,6 @@
--> tests/unit_tests/libs/broadcast_channel/redis/test_streams_channel.py:562:45
ERROR Argument `FakeStreamsRedis` is not assignable to parameter `client` with type `Redis[Unknown] | RedisCluster[Unknown]` in function `libs.broadcast_channel.redis.streams_channel._StreamsSubscription.__init__` [bad-argument-type]
--> tests/unit_tests/libs/broadcast_channel/redis/test_streams_channel.py:580:45
-ERROR Argument `dict[@_, @_]` is not assignable to parameter `headers` with type `HTTPHeaders` in function `botocore.awsrequest.AWSResponse.__init__` [bad-argument-type]
- --> tests/unit_tests/libs/test_archive_storage.py:160:50
-ERROR `dict[str, str]` is not assignable to attribute `description` with type `str | None` [bad-assignment]
- --> tests/unit_tests/libs/test_external_api.py:84:29
-ERROR Argument `_PassthroughFormatter` is not assignable to parameter `error_body_formatter` with type `ErrorBodyFormatter | None` in function `libs.external_api.ExternalApi.__init__` [bad-argument-type]
- --> tests/unit_tests/libs/test_external_api.py:285:72
-ERROR Argument `Unknown | None` is not assignable to parameter `blueprint` with type `Blueprint` in function `flask.sansio.app.App.register_blueprint` [bad-argument-type]
- --> tests/unit_tests/libs/test_external_api.py:399:28
-ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/libs/test_external_api.py:435:12
-ERROR Cannot index into `bool` [bad-index]
- --> tests/unit_tests/libs/test_external_api.py:436:12
-ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/libs/test_external_api.py:436:12
ERROR Class member `User.get_id` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
--> tests/unit_tests/libs/test_flask_utils.py:18:9
ERROR `str` is not assignable to dict key `error` with type `None` [bad-assignment]
@@ -5752,26 +5738,6 @@
--> tests/unit_tests/libs/test_helper.py:181:31
ERROR Argument `None` is not assignable to parameter `pattern` with type `str` in function `libs.helper.escape_like_pattern` [bad-argument-type]
--> tests/unit_tests/libs/test_helper.py:228:38
-ERROR Class member `TestCronCompatibility.setUp` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/libs/test_schedule_utils.py:22:9
-ERROR Class member `TestTimezoneCompatibility.setUp` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/libs/test_schedule_utils.py:177:9
-ERROR Class member `TestFrontendBackendIntegration.setUp` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/libs/test_schedule_utils.py:258:9
-ERROR Argument `VisualConfig | str` is not assignable to parameter `frequency` with type `str` in function `services.trigger.schedule_service.ScheduleService.visual_to_cron` [bad-argument-type]
- --> tests/unit_tests/libs/test_schedule_utils.py:319:60
-ERROR Argument `VisualConfig | str` is not assignable to parameter `visual_config` with type `VisualConfig` in function `services.trigger.schedule_service.ScheduleService.visual_to_cron` [bad-argument-type]
- --> tests/unit_tests/libs/test_schedule_utils.py:319:84
-ERROR Class member `TestEnhancedCronSyntax.setUp` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/libs/test_schedule_utils.py:389:9
-ERROR Class member `TestTimezoneHandlingEnhanced.setUp` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/libs/test_schedule_utils.py:578:9
-ERROR Class member `TestErrorHandlingEnhanced.setUp` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/libs/test_schedule_utils.py:675:9
-ERROR Class member `TestPerformanceEnhanced.setUp` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/libs/test_schedule_utils.py:719:9
-ERROR Class member `TestRegressionEnhanced.setUp` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/libs/test_schedule_utils.py:787:9
ERROR TypedDict `TenantCustomConfigDict` does not have key `feature1` [bad-typed-dict-key]
--> tests/unit_tests/models/test_account.py:657:23
ERROR TypedDict `TenantCustomConfigDict` does not have key `feature2` [bad-typed-dict-key]
|
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44885 +/- ##
=========================================
Coverage 89.79% 89.80%
=========================================
Files 6240 6241 +1
Lines 396400 391693 -4707
Branches 79971 79439 -532
=========================================
- Hits 355957 351744 -4213
+ Misses 34142 33850 -292
+ Partials 6301 6099 -202
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…t files Drop the three entries from the pyrefly exclude list now that the files are annotated, so strict checking covers them here.
Head branch was pushed to by a user without write access
951fa91 to
b217e9c
Compare
|
Style Check is green again - |
Reviewer asked to avoid `typing.cast`. Replace all sixteen casts with three small narrowing helpers (`_as_mapping`, `_as_items`, `_as_text`) that validate the JSON node before use, so the tests keep the same assertions without an escape hatch. The `check_no_new_cast` guard rejects net-new casts, aliases included.
|
All sixteen
Each validates with |
Summary
Enable strict pyrefly checking for 3 test files under
tests/unit_tests/libs/by removing them from the strict-mode exclusion list and fixing the resulting diagnostics:botocoreBaseClient/AWSRequest/AWSResponse/HTTPHeaders,TypedDictfor visual-config cases,MagicMock,Flask).@overrideto the eightsetUpoverrides and theUserMixin-style stub members (pattern already used inclients/agent_backend/test_client.py)._at(container, *keys)walker and explicitcasts, so nested assertions stay type-clean without loosening types.BadRequest.description = {...}to trigger param-error shaping, a minimalerror_body_formatterstand-in used before a flask-restx guard raises), and the loosely typedboto3.client(...)factory.Verification
pyrefly checkwith the unit-test strict config: 0 diagnostics for all 3 files.ruff format+ruff check: clean.scripts/check_no_new_test_doubles.py --base-rev main: no new test doubles.libs/files importtests/unit_tests/controllers/conftest, whose chain cannot be collected in this local Windows sandbox (hangs on import, same asevents//tasks/), so runtime coverage relies on CI.