Chris Calloway added the comment:

The attached patch issue-15518-1.patch replaces previous patch proposals for 
this issue.

The patch implements the suggestion to factor code common to report TestCase 
classes into a common base class BaseReportTestCase. Apologies for not having 
that in the previous patch.

Concerning the major point of msg186123, I had anticipated that there would 
need to be some discussion concerning the complexity of test data layouts and 
expected reports. So I have attached two visual aids to facilitate review and 
feedback. I made many such graphs when tracing the minimal path for complete 
test coverage and found them useful.

test_filecmp_layouts.rst details the directory and file layouts minimally 
necessary to provide complete test coverage for the report methods in 
filecmp.dircmp. The layouts are shown in pretty-printed os.walk format. 
test_filecmp_reports.rst details the reports which result from those layouts 
when all filecmp.dircmp report methods are exercised against them. The reports 
are shown as rendered by printing.

Both visual aids are laid out as tables, with TestCase names as column headers, 
and test_ method names within those TestCases as row headers. Both visual aids 
identify identical cells by an index number in the bottom right hand corner of 
each cell for cells that are duplicated.

The layouts table identifies six common directory and file layouts that would 
be necessary within a proposed filecmpdata directory. I had created these 
layouts in setUp methods in order to follow the pre-existing style of the test 
script. I agree that doing so added to the test code complexity. I agree with 
the suggestion to instead put the layouts in a filecmpdata directory. Before I 
revise the patch to do that, however, I just want in understood that there are 
six layouts minimally necessary in the proposed filecmpdata.

Placing the layouts in a filecmpdata directory will eliminate the need for a 
tearDown method in BaseReportTestCase. Placing layouts in a filecmpdata 
directory will faciliate the revision of the pre-existing TestCases in the 
script, as they use similar layouts currently created in setUp methods and 
modified in test_ methods.

----------
Added file: http://bugs.python.org/file29747/issue-15518-1.patch

_______________________________________
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