-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Finish exporting for each start exporting #5758
Merged
wRAR
merged 8 commits into
scrapy:master
from
MattyMay:finish_exporting_for_each_start_exporting
Jan 12, 2023
Merged
Finish exporting for each start exporting #5758
wRAR
merged 8 commits into
scrapy:master
from
MattyMay:finish_exporting_for_each_start_exporting
Jan 12, 2023
Conversation
This file contains 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
I accidentally called the wrong super method in overriden finish_exporting
Codecov Report
@@ Coverage Diff @@
## master #5758 +/- ##
==========================================
+ Coverage 84.82% 88.87% +4.04%
==========================================
Files 162 162
Lines 10974 10980 +6
Branches 1795 1796 +1
==========================================
+ Hits 9309 9758 +449
+ Misses 1394 941 -453
- Partials 271 281 +10
|
Closing and reopening to trigger new CI jobs… |
Gallaecio
approved these changes
Jan 11, 2023
wRAR
approved these changes
Jan 12, 2023
Thanks! |
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.
Figured I'd take a crack at #5537 since it's been stale for a while.
This patch moves the call to
slot.finish_exporting()
up to before the conditional that checks ifslot.item_count > 0
so that if an exception occurs when an exporter'sexport_item()
method is called,slot.finish_exporting()
will still be called (as discussed in the issue).I've included 4 new tests to that each check that:
slot.start_exporting()
was called that there is a call toslot.finish_exporting()
afterslot.finish_exporting()
is not called before a call toslot.start_exporting()
. I.e. they assert thatslot.finish_exporting()
isn't called twice in a row without a call toslot.start_exporting()
in between and thatslot.finish_exporting()
isn't called before an initial call toslot.start_exporting
.test_start_finish_exporting_items_exception
fails before the patch and passes after the patch. The other 3 tests pass before and after.Fixes #5537