You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
faststream 0.7.7 breaks the logging-teardown test's __class__ assignment #253
faststream 0.7.7 was published 2026-09-23T20:36Z. The last CI run here was 2026-09-23T11:14Z, so main is green but has not seen it. Every job that resolves newest will go red on the next run.
The failure
tests/test_faststream_bootstrap.py::test_faststream_logging_teardown_runs_super_when_broker_write_raises
> logger_state.__class__ = _BrokenLoggerState
E TypeError: __class__ assignment: '_BrokenLoggerState' object layout differs from 'LoggerState'
tests/test_faststream_bootstrap.py:324: TypeError
Bisected
Against a clean checkout of main at 2f0c9f4, changing only the faststream version:
The test swaps in a broken subclass by assigning __class__ on a live LoggerState. That is only
legal when both classes share an object layout, so any upstream change to LoggerState's shape
(__slots__, a base class, a different model config) makes the assignment a TypeError regardless
of what the test was trying to exercise. It is the test technique that broke, not the behaviour
under test, so 0.7.7 is not necessarily a regression in faststream.
Worth deciding whether the test should keep using __class__ assignment at all. Constructing the
broken state directly, or patching the method rather than the class, would not be sensitive to
upstream layout.
Not related to the floors work
Found while verifying #254, which touches only the floors leg and a new
test. The floors leg itself is unaffected: it resolves faststream at its declared floor, not at
newest, and all 25 legs pass. This failure is on the pytest job, which resolves newest, so that
PR will show it too.
Fixed by #256, which replaces the __class__ assignment with a data descriptor patched onto the class. Confirmed: the five pytest legs on #254 went from red to green against the updated base, with no change to that branch and no faststream release since 0.7.7.
Activity
lesnik512 commentedon Sep 25, 2026
Fixed by #256, which replaces the
__class__assignment with a data descriptor patched onto the class. Confirmed: the fivepytestlegs on #254 went from red to green against the updated base, with no change to that branch and no faststream release since 0.7.7.