Zachary Ware added the comment:
I agree that, long-term, test_robotparser should probably be rewritten with
less magic. Short-term, though, I think it would be good to get a temporary
fix for discovery in place since this is the only test file that completely
blows up discovery before it
Roundup Robot added the comment:
New changeset fa051c6276a0 by Ezio Melotti in branch '3.3':
#17066: test_robotparser now works with unittest test discovery. Patch by
Zachary Ware.
http://hg.python.org/cpython/rev/fa051c6276a0
New changeset 8fdce849d0b3 by Ezio Melotti in branch 'default':
Ezio Melotti added the comment:
Fixed, thanks for the patch!
--
assignee: - ezio.melotti
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17066
Ezio Melotti added the comment:
Do you think doing something like:
class BaseRobotTest:
def setUp(self):
lines = io.StringIO(robots_txt).readlines()
self.parser = urllib.robotparser.RobotFileParser()
parser.parse(lines)
def test_good(self):
for url in
Zachary Ware added the comment:
I got to looking over my patch here again, and thought of another possible fix.
I'm not sure which is uglier, though :)
The problem is that most of the test cases are created using a custom subclass
of unittest.TestCase which takes extra constructor arguments.
Changes by Zachary Ware zachary.w...@gmail.com:
Added file: http://bugs.python.org/file29308/test_robotparser_discovery.v3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17066
___
New submission from Zachary Ware:
Here's a fix for test_robotparser.py. With this patch, the command 'python -m
unittest discover Lib/test/ test_*.py' can actually be run--before the patch,
test_robotparser's unique TestCase subclass causes unexpected errors for
discovery.
--