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 eli.bendersky
Recipients Ankur.Ankan, cbc, chris.jerdonek, eli.bendersky
Date 2013-04-06.13:00:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1365253232.49.0.293606675141.issue15518@psf.upfronthosting.co.za>
In-reply-to
Content
A lot of the code in the tests is devoted to building the tested directory tree and populating it ( _setUpDirectories and related functions). You keep building and deleting this tree for every running test.

I think that a better idea would be to just create this tree somewhere in Lib/test (look at the directories under it - we can add a new one, like filecmpdata/) and then refer to it in the tests. This will remove a huge amount of code and should also make it easier to understand what exactly the contents of this tree are. For example then I can use other system Linux tools to explore the directory and figure out what I'd expect the tests to do.

When test data is very small and contained, it makes sense to just create it while the test is running. But the patch has > 120 LOC for that with functions calling other functions. For someone not intimately familiar with the tests, it's hard to follow which files get created and their contents.

Other comments:

* Don't use external functions with 'self' to serve essentially as methods. Test classes can derive from some common class that provides such functionality. [not sure this will be relevant after the above refactoring]
* If you do pretty much the same thing for every tearDown, also consider refactoring it into a base class.
History
Date User Action Args
2013-04-06 13:00:32eli.benderskysetrecipients: + eli.bendersky, chris.jerdonek, cbc, Ankur.Ankan
2013-04-06 13:00:32eli.benderskysetmessageid: <1365253232.49.0.293606675141.issue15518@psf.upfronthosting.co.za>
2013-04-06 13:00:32eli.benderskylinkissue15518 messages
2013-04-06 13:00:31eli.benderskycreate