-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
We need tests for example code #11340
Comments
|
|
|
This code might serve as a good example, or at least, an example: http://divmod.org/trac/browser/trunk/Nevow/nevow/test/test_howtolistings.py |
We should resolve this ticket with a plan about how to write testable examples. Then, indeed, there can be many more tickets for replacing (which may not actually mean deleting and rewriting in all cases, existing examples that can be reformed should be) existing examples with tested equivalents. |
Even better than a plan would be a plan plus an actual example of a test harness for a particular example or set of examples. |
Well, let me update the link glyph posted, then: |
In ticket:5596:names-examples-tests-5596.patch Download
I copied and modified the Nevow example testing mixin mentioned above. Maybe the same tests can be re-used on other examples. |
(In [37383]) Branching to 'testable-examples-84' |
Replying to exarkun:
I've started a new Wiki page with the outlines of a plan. There is also a branch where I added some further tests for the twisted.names examples.
Before I go any further I'd appreciate a review of the plan. Tell me which parts of the plan make sense, and I will create corresponding tickets where the discussion can continue. Other parts of the plan I will refine or ditch, based on feedback. |
That is a very well thought out document. Thanks.
I'm not sure if there is a good single measure. Those are both reasonable hints. Perhaps some measure of complexity, or extraneous complexity would be good.
|
Some comments on the code in the branch (which should eventually be attached to a separate ticket:
|
Some other comments:
|
I'd like to emphasize this. I think we actually want to turn all the examples into howtos. An example with narration is vastly more educational than an example in a void. |
Replying to exarkun:
One way of handling this would be to move all example code out of the howto documents into separate python files, for ease of testing. Then pull relevant parts of the code (functions, classes, line number ranges, etc) into the howto documents for rendering into HTML. This might make things a bit more difficult for HOWTO authors, however, as they would have to be looking at two different files when writing up their docs. Lore can only do this by line number, though IIRC there is a ticket for other types of includes. (aha - #11558) Sphinx can do this, but obviously we haven't switched over to Sphinx at this point in time. In any case, I'm really only talking about long-term plans here. Nothing that should delay or derail this ticket. |
Lots of existing howtos already do this. I don't think there's much (if any) deficiency in the current tool support. |
Thanks for all the feedback. I've started creating some separate tickets and added links to the plan: I'll do more later. |
Taking this out of review, as there isn't really anything actionable in here to review. |
Searchable metadata
The text was updated successfully, but these errors were encountered: