New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ChainMap observers fix #8305
ChainMap observers fix #8305
Conversation
Observers should not be shared across different instances. Aside from unwanted behavior, this can lead to object leaks (like celery app objects not being garbage collected).
for more information, see https://pre-commit.ci
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #8305 +/- ##
==========================================
- Coverage 87.16% 87.15% -0.01%
==========================================
Files 148 148
Lines 18469 18469
Branches 3097 3148 +51
==========================================
- Hits 16098 16097 -1
- Misses 2092 2094 +2
+ Partials 279 278 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
callback = Mock() | ||
a.bind_to(callback) | ||
b.update(x=1) | ||
callback.assert_not_called() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we lean to pytest like syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there an alternative to assert_not_called
and assert_called_once_with
in pytest?
I see they are used extensively in celery unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh sorry my mistake!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need anything else from me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to increase test coverage and if possible to add integration tests as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird that I reduced coverage by this commit - It's just a bugfix with a new unit test that checks it actually fixed the bug (I didn't add any new "logic" to the code itself).
It also feels like a low-level bug that doesn't suit an integration test.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codecov sometimes do mistakes :D
Observers should not be shared across different instances. Aside from unwanted behavior, this can lead to object leaks (like celery app objects not being garbage collected).