[2.7] bpo-30759: Copy test_robotparser from master#2546
[2.7] bpo-30759: Copy test_robotparser from master#2546vstinner merged 1 commit intopython:2.7from vstinner:robotparser27
Conversation
|
test_robotparser was rewritten in bpo-25497 (4da0fd0) by @berkerpeksag. Maybe try to cherry-pick 4da0fd0 and compare results? |
There was a problem hiding this comment.
RobotHandler is a subclass of BaseHTTPServer.BaseHTTPRequestHandler, not unittest.TestCase.
There was a problem hiding this comment.
Fixed. Funny that support.run_unittest() doesn't report such bug :-)
Copy Lib/test/test_robotparser.py from master to 2.7 and adapt it for Python 2.7: * Replace urllib.robotparser with robotparser * Adjust HTTPServer import * Replace io.StringIO with StringIO.StringIO * Remove tests on crawl_delay() and request_rate() since these methods were added to Python 3 * Remove subTest() * Add test_main() which explicitly lists all test cases Patch based on the commit 4da0fd0 written by Berker Peksag. Co-Authored-By: Berker Peksag <[email protected]>
|
Oh, I don't know what happened: I did remove the 2 unused imports, but I see them in the first version of my PR? Well, it doesn't matter, I just removed them :-) I fixed the 3 reports issues. Serhiy: "test_robotparser was rewritten in bpo-25497 (4da0fd0) by @berkerpeksag. Maybe try to cherry-pick 4da0fd0 and compare results?" Sorry, but I don't want to try to cherry-pick such large refactoring change from Python 3 to Python 2, the cherry-pick creates a file full of conflcts. IMHO it's simpler to start with a fresh copy of the file, and then adapt it for Python 2. I credited @berkerpeksag in my commit message. |
|
@serhiy-storchaka, @berkerpeksag: Does it look better now? |
|
Ok, thank you for the review @berkerpeksag. Let's go! |
Copy Lib/test/test_robotparser.py from master to 2.7 and adapt it for
Python 2.7:
methods were added to Python 3