Eli Bendersky added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15518>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to