8000 Restructure download handler tests. by wRAR · Pull Request #6821 · scrapy/scrapy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Restructure download handler tests. #6821

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

Merged
merged 3 commits into from
May 27, 2025
Merged

Conversation

wRAR
Copy link
Member
@wRAR wRAR commented May 22, 2025

This tries to reshuffle the test code to allow running the code with alternative download handlers. New structure:

  • test_downloader_handlers.py: tests for DownloadHandlers and for specific non-HTTP download handlers
  • test_downloader_handlers_http_base.py: only base classes for HTTP download handlers
  • test_downloader_handler_twisted_http*.py: tests for HTTP10DownloadHandler, HTTP11DownloadHandler and H2DownloadHandler.

All the actually run test methods should be the same, except for 2 new but skipped methods in test_downloader_handler_twisted_http10.TestHttp10Proxy. The 1.1 and 2 files are now independent from each other, only depending on the base file, though some 2 classes inherit from 1.1 ones, which I don't think we can do anything about as the protocols do the same. We may need some more restructuring when we actually get alternative handlers, especially ones with 2.0, but this is a first step.

Copy link
codecov bot commented May 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.78%. Comparing base (ff7d296) to head (f2d7a64).
Report is 3 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6821   +/-   ##
=======================================
  Coverage   90.78%   90.78%           
=======================================
  Files         164      164           
  Lines       12381    12381           
  Branches     1609     1609           
=======================================
  Hits        11240    11240           
  Misses        834      834           
  Partials      307      307           

@wRAR wRAR mentioned this pull request May 24, 2025
Copy link
Member
@Gallaecio Gallaecio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@wRAR wRAR marked this pull request as draft May 27, 2025 06:57
@wRAR wRAR marked this pull request as ready for review May 27, 2025 12:39
@wRAR wRAR merged commit b41aea4 into scrapy:master May 27, 2025
60 of 62 checks passed
@wRAR wRAR deleted the restructure-http-tests branch May 27, 2025 13:19
fanisorfan pushed a commit to fanisorfan/scrapy that referenced this pull request Jun 3, 2025
* Restructure download handler tests.

* Typo.

* Use mixins to reduce boilerplate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0