This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Improve Test Coverage Of Pydoc
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Matt.Bachmann, python-dev, r.david.murray, raduv
Priority: normal Keywords: patch

Created on 2013-03-18 18:37 by Matt.Bachmann, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pydoctests.patch Matt.Bachmann, 2013-03-18 18:37 Updates to test, adding myself to ACKS review
pydoc_tests_v2.patch Matt.Bachmann, 2013-03-18 20:02 Updates to previous patch review
pydoc_tests_v3.patch Matt.Bachmann, 2013-03-19 02:58 Updated patch file addressing comments review
Messages (9)
msg184486 - (view) Author: Matt Bachmann (Matt.Bachmann) * Date: 2013-03-18 18:37
Adds some test coverage to pydoc.
msg184503 - (view) Author: Radu Voicilas (raduv) Date: 2013-03-18 19:51
Hi,

Here are some small comments to your otherwise good to have patch:

-- assertEquals has been deprecated in favor of assertEqual, and usually it's great to be consistent across the test suite
-- likewise maxDiff should be max_diff mainly because of consistency and because of pep8's naming styles
-- self.temp_dir is never cleaned up (on tearDown maybe?) and gettempdir() doesn't really look like a good option; maybe you wanted to create a new temporary directory rather than pointing to the filesystem's tmp dir ?
-- the patch doesn't apply cleanly, at least for me - the ACKS hunk is failing for me
msg184504 - (view) Author: Matt Bachmann (Matt.Bachmann) * Date: 2013-03-18 19:52
Sure thing, ill make the improvements and upload a new patch. Thanks!
msg184507 - (view) Author: Matt Bachmann (Matt.Bachmann) * Date: 2013-03-18 20:02
--Changes assertequals to assertequal
--Removes maxdiff as it should not really be there in the first place
--Creates an explicit testdir, and cleans it up
--Last patch did not actually apply cleanly... I reverted and applied this one and this seems to work
msg184570 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-03-19 00:43
Thanks for the patch.

Rather than create and destroy a directory for every test (setUp/tearDown), it is possible to use the test.support.temp_cwd context manager to create and destroy one inside the single tests that need it.

A nit: we prefer to keep the line length to <80 (that is, max 79).

In test_getting_all_methods_from_class, why is 'method_returning_true' not in the list?  I also worry that this test is a bit fragile, but I don't have a good suggestion for how to fix that, so we'll probably just have to live with it.
msg184582 - (view) Author: Matt Bachmann (Matt.Bachmann) * Date: 2013-03-19 02:58
Thanks for the feedback :-D

Changes:

Utilize test.support.temp_cwd()
Removed imports that this made unnecessary
 Awesome trick!

Cut line length down. Don't worry about nitpicking. Anything to get this to be as good as possible.

I added an explanation to the test class explaining why test_getting_all_methods_from_class does not appear. I also agree this is fragile. I have an idea for how to fix this and will upload it as a separate patch (in this thread) because I am not sure what people will think.
msg184584 - (view) Author: Matt Bachmann (Matt.Bachmann) * Date: 2013-03-19 03:36
Eh, sorry... I tried to do a less fragile way of generating the configuration dict. Tried a few things but it very quickly got messy and even worse started to smell like testing the method with... the method being tested.

I am open to ideas though.
msg184587 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-03-19 04:04
New changeset 474f078ec958 by R David Murray in branch 'default':
#17464: improve pydoc test coverage.
http://hg.python.org/cpython/rev/474f078ec958
msg184588 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-03-19 04:05
As discussed with Matt, I deleted the allmethods tests, since the current behavior is actually a bug.  pydoc itself doesn't use allmethods, but I did find that numpy at least does so.  A separate issue will be opened for that bug.
History
Date User Action Args
2022-04-11 14:57:43adminsetgithub: 61666
2013-03-19 04:05:51r.david.murraysetstatus: open -> closed
versions: + Python 3.4, - Python 3.5
messages: + msg184588

resolution: fixed
stage: resolved
2013-03-19 04:04:06python-devsetnosy: + python-dev
messages: + msg184587
2013-03-19 03:36:34Matt.Bachmannsetmessages: + msg184584
2013-03-19 02:58:41Matt.Bachmannsetfiles: + pydoc_tests_v3.patch

messages: + msg184582
2013-03-19 00:43:06r.david.murraysetnosy: + r.david.murray
messages: + msg184570
2013-03-18 20:02:08Matt.Bachmannsetfiles: + pydoc_tests_v2.patch

messages: + msg184507
2013-03-18 19:52:24Matt.Bachmannsetmessages: + msg184504
2013-03-18 19:51:12raduvsetnosy: + raduv
messages: + msg184503
2013-03-18 18:37:38Matt.Bachmannsettype: enhancement
components: + Tests
2013-03-18 18:37:26Matt.Bachmanncreate