Skip to content

test: patch params_storage on the class so the teardown test survives faststream 0.7.7's __slots__ - #256

Merged
lesnik512 merged 1 commit into
mainfrom
test/faststream-slotted-logger-state
Sep 25, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
test/faststream-slotted-logger-state

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Fixes the scheduled dependency check, red since 2026-09-24 (run 36130214503).

faststream 0.7.7 gave LoggerState __slots__ = ('log_level', 'logger', 'params_storage'). test_faststream_logging_teardown_runs_super_when_broker_write_raises promoted the instance to a subclass via __class__ assignment, which CPython refuses once the layouts differ, so the test errored and coverage fell to 99.87%.

The test now uses monkeypatch.setattr(type(logger), "params_storage", property(fset=...), raising=False). A data descriptor on the class wins over both a slot and an instance __dict__, so the same test works before and after the change, and monkeypatch restores the original descriptor afterwards. No library code changes: the other 330 tests already pass on 0.7.7.

Verified: full suite 331 passed at 100% coverage on faststream 0.7.7; the faststream test module also passes on 0.7.6 and on the 0.6.0 floor; just lint-ci green.

@lesnik512
lesnik512 merged commit c312fd2 into main Sep 25, 2026
13 checks passed
@lesnik512
lesnik512 deleted the test/faststream-slotted-logger-state branch September 25, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant