Repository navigation
Conversation
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-11-03 02:31:35.225358687 +0000
+++ /tmp/pyrefly_pr.txt 2026-11-03 02:31:21.729246498 +0000
@@ -5616,18 +5616,6 @@
--> tests/unit_tests/enterprise/telemetry/test_contracts.py:128:30
ERROR Missing argument `payload` in function `enterprise.telemetry.contracts.TelemetryEnvelope.__init__` [missing-argument]
--> tests/unit_tests/enterprise/telemetry/test_contracts.py:137:30
-ERROR Object of class `Events` has no attribute `request_start` [missing-attribute]
- --> tests/unit_tests/events/test___init__.py:10:5
-ERROR Object of class `Events` has no attribute `request_end` [missing-attribute]
- --> tests/unit_tests/events/test___init__.py:11:5
-ERROR Object of class `Events` has no attribute `request_start` [missing-attribute]
- --> tests/unit_tests/events/test___init__.py:27:5
-ERROR Object of class `Events` has no attribute `request_start` [missing-attribute]
- --> tests/unit_tests/events/test___init__.py:28:5
-ERROR Object of class `Events` has no attribute `request_start` [missing-attribute]
- --> tests/unit_tests/events/test___init__.py:33:5
-ERROR Missing argument `session` in function `events.event_handlers.update_app_dataset_join_when_app_model_config_updated.handle` [missing-argument]
- --> tests/unit_tests/events/test_app_event.py:193:19
ERROR Object of class `NoneType` has no attribute `partition` [missing-attribute]
--> tests/unit_tests/extensions/logstore/repositories/test_logstore_api_workflow_node_execution_repository.py:58:34
ERROR `<=` is not supported between `None` and `int` [unsupported-operation]
@@ -5656,8 +5644,6 @@
--> tests/unit_tests/extensions/test_ext_celery.py:98:18
ERROR Object of class `Connection` has no attribute `SimpleQueue` [missing-attribute]
--> tests/unit_tests/extensions/test_ext_celery.py:103:18
-ERROR Argument `Literal['browser']` is not assignable to parameter `type` with type `EndUserType | SQLCoreOperations[EndUserType]` in function `models.model.EndUser.__init__` [bad-argument-type]
- --> tests/unit_tests/extensions/test_ext_login.py:53:14
ERROR Argument `list[FromClause]` is not assignable to parameter `tables` with type `Sequence[Table] | None` in function `sqlalchemy.sql.schema.MetaData.create_all` [bad-argument-type]
--> tests/unit_tests/factories/file_factory/test_builders.py:85:58
ERROR Object of class `NoneType` has no attribute `storage_key` [missing-attribute]
|
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44875 +/- ##
========================================
Coverage 89.77% 89.77%
========================================
Files 6238 6238
Lines 390615 390848 +233
Branches 79229 79264 +35
========================================
+ Hits 350671 350882 +211
- Misses 33851 33868 +17
- Partials 6093 6098 +5
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:
|
asukaminato0721
enabled auto-merge
October 27, 2026 13:43
|
|
||
| events.request_start += lambda: calls.append("start") | ||
| events.request_end += lambda: calls.append("end") | ||
| events.request_start += lambda: calls.append("start") # type: ignore[attr-defined] |
Contributor
There was a problem hiding this comment.
can we avoid so many ignore?
Contributor
Author
There was a problem hiding this comment.
Cut them from 11 to 5. Reads through Events.__getattr__ resolve on their own, so only the augmented assignments still need one: += writes the slot back onto the instance, and pyrefly does not use the __getattr__ return type on the write path.
asukaminato0721
requested changes
Oct 29, 2026
Reads through __getattr__ resolve on their own, so only the augmented assignments that write the slot back keep the ignore.
auto-merge was automatically disabled
October 30, 2026 03:45
Head branch was pushed to by a user without write access
shi-felix
force-pushed
the
refactor/pyrefly-strict-test-batch-9
branch
from
October 30, 2026 03:45
075cee2 to
08ac2e8
Compare
`MagicMock()` is already assignable to the `session` parameter, so the `typing.cast("Session", ...)` was redundant and tripped the `check_no_new_cast` guard. Removing it also drops the now-unused `cast` and `Session` imports.
| arguments = handler._extract_arguments(AppGenerateService.generate, **kwargs) | ||
| arguments = handler._extract_arguments( | ||
| AppGenerateService.generate, | ||
| session=MagicMock(), |
asukaminato0721
requested changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enable strict pyrefly checking for 12 test files under
tests/unit_tests/events/andtests/unit_tests/extensions/by removing them from the strict-mode exclusion list and fixing the resulting diagnostics:AppServices,sessionmaker[Session],TracerProvider,InMemorySpanExporter,App,Account,MagicMock,sqlite3.Connection, ...).-> None/-> str/Generator[...]return annotations (fixtures that yield now declareGenerator).get_query()/get_to()) with asserts, and useEndUserType.BROWSERinstead of a raw string literal.execute_querywrappers to mirror the realAliyunLogStore.execute_sqlsignature instead of unpacking**kwargs: object.MagicMockcall bookkeeping, protocol-abstract members that these tests never call, and the dynamicEventsslots), matching existing usage in the suite.Verification
pyrefly checkwith the unit-test strict config: 0 diagnostics for all 12 files.ruff format+ruff check: clean.pyteston the runnable subset (extensions/otel, extensions/logstore, ext_socketio/ext_login/ext_redis/warm_shutdown): 117 passed. The 5 errors fromnon_utc_host_timezone(time.tzset()is POSIX-only) reproduce onmainunchanged, andtests/unit_tests/events/cannot be collected in this local Windows sandbox (conftest environment deps hang on import), so those files are covered by CI.