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.
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
External watch fix init #4030
External watch fix init #4030
Changes from all commits
bbb436c
c399655
322c45c
3f56be2
ca6a499
872025b
794e489
dc81c3b
1e682c2
a3984c3
2bd8589
8b349e3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This was checking if it could find an apple in a list of tuples of oranges and apples.
Instead, we must unpack the tuples in the list and compare apples to apples.
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.
The test name/docstring says it's checking that we skip duplicate watchers, but the test no longer involves a duplicate watcher. It seems to just be checking the basic usage of
watch
, which is probably covered by another test.I reckon this should be updated such that are two watchers defined with
self.watch(self.holder, "attr", self.callback)
, and checking that theself.callback
fires only once on init, and once again on setting the value ofattr
.Perhaps more importantly, another test should probably cover this case: If I define one watcher as
self.watch(self.holder, "attr", self.first_callback)
and then another withself.watch(self.holder, "attr", self.second_callback)
. Do I see one run ofself.first_callback
followed by one run ofself.second_callback
on init? Then when I assignattr
, do I see the another one run of each callback in the correct order?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.
As for the first two paragraphs, I think I deleted the second callback when I was debugging the bug I mentioned in a previous commit and then forgot to add it again, thanks for spotting that...
As for the third paragraph... Do you mean something like the test
test_external_watch_init_does_not_propagate_to_externals
added in 8b349e3?