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.

Author eric.araujo
Recipients eric.araujo
Date 2011-11-21.17:08:02
SpamBayes Score 1.852159e-10
Marked as misclassified No
Message-id <1321895284.05.0.389852057258.issue13447@psf.upfronthosting.co.za>
In-reply-to
Content
When people find bugs in reindent.py (#12930 is a recent one), we have to try to reproduce the bug manually, apply a fix and test manually again.  The alternative is to only read the code and trust that it works.  I find both of these positions unsatisfactory and propose to add unit tests for the script.  I’m opening this report to gather votes, and if they’re positive I’ll proceed with a patch and other bug reports for the other most used scripts (we have a number of reports for pygettext and msgfmt for example; I am not proposing adding tests for all, or even most, scripts).

Even if these scripts are not part of the stdlib and not officially documented or supported, we do ship them and use them (reindent from patchcheck and Mercurial hooks for example), so I really think we need unit tests to know that they work as intended.  Then we’ll be able to commit fixes and other changes serenely.

Implementation idea: The tests would go in Tools/scripts/tests/test_reindent.py and a short file in Lib/test/test_scripts.py would run them as part of the test suite if they exist (so that running tests from an installed Python without Tools dir just skips test_scripts).  For scripts that are in another Tools subdir, like Tools/i18n/pygettext.py, I’d put them in Tools/i18n/tests/test_pygettext.py.
History
Date User Action Args
2011-11-21 17:08:04eric.araujosetrecipients: + eric.araujo
2011-11-21 17:08:04eric.araujosetmessageid: <1321895284.05.0.389852057258.issue13447@psf.upfronthosting.co.za>
2011-11-21 17:08:03eric.araujolinkissue13447 messages
2011-11-21 17:08:03eric.araujocreate