[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-12-03 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


Removed file: http://bugs.python.org/file30040/issue-15518-1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15518
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-12-03 Thread Chris Calloway

Chris Calloway added the comment:

The promised comments have been added to the patch. The refactoring of the 
pre-existing tests is not part of this patch. But I'm uploading this now as the 
patch does fix the issue.

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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15518
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-12-03 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


Removed file: http://bugs.python.org/file29745/test_filecmp_layouts.rst

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15518
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-12-03 Thread Chris Calloway

Chris Calloway added the comment:

Reformat the filecmpdata directory layouts diagram.

--
Added file: http://bugs.python.org/file32961/test_filecmp_layouts.rst

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15518
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-12-03 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


Removed file: http://bugs.python.org/file29746/test_filecmp_reports.rst

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15518
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-12-03 Thread Chris Calloway

Chris Calloway added the comment:

Reformat the filecmp test report matrix.

--
Added file: http://bugs.python.org/file32962/test_filecmp_reports.rst

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15518
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-12-03 Thread Chris Calloway

Chris Calloway added the comment:

Formatted test directory layout.

--
Added file: http://bugs.python.org/file32963/layouts.html

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15518
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-12-03 Thread Chris Calloway

Chris Calloway added the comment:

Format the martix of test reports.

--
Added file: http://bugs.python.org/file32964/reports.html

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15518
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-27 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


Removed file: http://bugs.python.org/file29758/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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-27 Thread Chris Calloway

Chris Calloway added the comment:

I'm uploading a new patch which gets rid of the temp_cwd calls as suggested in 
the review. The patch is not complete in that the explanatory comments 
suggested in the review and revising the pre-existing tests have not been 
completed yet. However, I want to upload the work I do have as it has been a 
couple of weeks since reivew and I won't have another opportunity to complete 
the review suggestions until PUG project nights on May 7th and 8th.

Also, I'm uploading this new patch because the previous patch had a serious 
problem that caused this delay. I happened to get a new laptop and used the 
previous patch to recreate the tests. I found that part of the new filecmpdata 
directory was missing when I did that and some of the tests failed as a result.

It turns out that hg add and hg diff were not detecting all of filecmpdata. 
There's a well known problem with hg no detecting empty directories. However, 
this was not the case in this patch. Because I was able to workaround the 
problem by recreating all the dir-same directories and all their 
subdirectories, I think the problem is with hg not detecting directories with 
identical contents if the creation dates are the same. It's something I'll need 
to investigate more when this issue has been completed.

--
Added file: http://bugs.python.org/file30040/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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-09 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


Removed file: http://bugs.python.org/file29749/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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-09 Thread Chris Calloway

Chris Calloway added the comment:

I replaced issue-15518-1.patch. I believe it now addresses all the concerns 
expressed thus far. If reviewed favorably, I will extend it to clean-up the 
pre-existing tests to address the concerns noted about them, especially since 
the filecmpdata directory added by this patch contains the information 
necessary to test the rest of the filecmp module rather than resorting to 
creating temp directories and files. It seems less than ideal to me to have the 
test script use a mixed model for accessing test data (both temp and 
filecmpdata directories). But that's not my call.

--
Added file: http://bugs.python.org/file29758/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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


Removed file: http://bugs.python.org/file29682/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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

Chris Calloway added the comment:

The attached file test_filecmp_layouts.rst documents the directory and file 
layouts for complete test coverage of filecmp.dircmp report methods to aid in 
review discussion of patch.

--
Added file: http://bugs.python.org/file29745/test_filecmp_layouts.rst

___
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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

Chris Calloway added the comment:

The attached file test_filecmp_reports.rst documents the reports generated by 
filecmp.dircmp test methods if the directory and file layouts in 
test_filecmp_layouts.rst are followed to aid in review discussion of patch.

--
Added file: http://bugs.python.org/file29746/test_filecmp_reports.rst

___
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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


Removed 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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-08 Thread Chris Calloway

Chris Calloway added the comment:

Fix calls to BaseReportTestCase methods in subclasses. Not an override so don't 
need super().

--
Added file: http://bugs.python.org/file29749/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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-04 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


Removed file: http://bugs.python.org/file26635/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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-04 Thread Chris Calloway

Chris Calloway added the comment:

OK, I got to participate in my Python user group hack night this week where I 
actually got to work on my projects instead of spending all night helping 
newbies on their projects. I used the time to refactor all the previous patches 
for this issue on which I had previously been working into the attached 
issue-15518-1.patch (replacing previous patch of the same name). I believe this 
patch a) provides the necessary minimum test coverage for the report methods, 
b) addresses chris.jerdonek's and eli.bendersky concerns, and c) does a strict 
PEP8 clean-up of the pre-existing tests (without changing pre-existing code). 
If you like this patch, I'd be glad to refactor the pre-existing tests to a) 
put each pre-existing test in its own TestCase methods and b) clean-up the 
unmaintainable proliferation of repeated hard-coded strings in the pre-existing 
tests. Feedback appreciated.

--
Added file: http://bugs.python.org/file29681/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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-04 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


Removed file: http://bugs.python.org/file29681/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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-04-04 Thread Chris Calloway

Chris Calloway added the comment:

Replaced patch to fix a few under-informative test messages.

--
Added file: http://bugs.python.org/file29682/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



[issue15351] Add to unittest.TestCase support for using context managers

2013-04-02 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


--
nosy: +cbc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15351
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2013-03-11 Thread Chris Calloway

Chris Calloway added the comment:

Yes, that's why I opened it. Feel free to submit patches if you think I'm 
moving too slowly.

--

___
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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2012-10-17 Thread Chris Calloway

Chris Calloway added the comment:

I have a number of patches for this issue I have worked on during a few local 
Python user group hack nights. I have not submitted them yet, however, as they 
require some expository material here in order to illustrate how they address 
Jerdonek's points. I have a regional Python conference (PyCarolinas) that I 
have some responsibilities in through the weekend, however, and will not be 
able to move forward ASAP until after then.

--

___
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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2012-08-02 Thread Chris Calloway

Chris Calloway added the comment:

Well, really, the reason I'm deferring is to get the patch accepted, because it 
seems kind of unacceptable for standard library modules not to have full test 
coverage. So far, I don't see evidence that the issue has even been triaged. Of 
the three approaches, regex, cd, or decoration, which do you see as most likely 
to be accepted? I understand that cd might be common in some tests. But it also 
appears that, at least in test_filecmp, some pretty heinous practices are also 
common like piling a ridiculous number of asserts into one test method. (And 
I'll fix that, too.) I do really appreciate your advice, core developer or not. 
You are the only one providing advice here.

--

___
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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2012-08-01 Thread Chris Calloway

Chris Calloway added the comment:

 There are at least two ways you could deal with this.  You could change the 
 working directory to the temp directory in setUp() and change it back in 
 tearDown().  This is a common pattern in the tests [...]

 Alternatively, you could save the temp directory path as an attribute of the 
 test class, and then include it in your string match prior to calling the 
 assert method.

Although I prefer explicitly testing that the subdirectory paths shows up in 
the reports and, in the case of the report_partial_closure test, the regex 
explicitly tests that the only in subdirectory is reported correctly, if I 
were to have to choose between the two options you propose, I would choose 
decorating the test instance with the strings as that would at least preserve 
the ability to perform the latter of the two explicit tests I mention and would 
not be subject to yet another file system point of failure while switching 
directories (even if that is a common pattern in the tests).

assertRegex is new from unittest2 and seems tailor-made for this use case to 
me. It gets the job done in explicitly correctly in the least amount of code. 
If you insist that I not use assertRegex for the report test, I will yield to 
your preferences. However, I would like your blessing to continue with 
assertRegex in this case.

In either event, I still will refactor the patch into separate test methods for 
the report methods as previously agreed after your continued feedback. And 
thank you again for your feedback above.

--

___
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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-31 Thread Chris Calloway

Chris Calloway added the comment:

At the PyOhio sprints, I noticed this issue and found it interesting for low 
hanging fruit. First I went to make tests for this enhancement, only to find 
that report(), report_partial_closure(), and report_full_closure did not 
already have tests.

In adding tests for these methods, I also found that dircmp is only tested for 
one directory level, leaving out coverage for a pretty wide swath of dircmp.

The first patch I'm submitting here is just for the report methods for the 
level of dircmp testing which already exists. A subsequent patch will test the 
report methods a couple of directory levels deep to get full coverage for 
report_full_closure().

Even if this enhancement is not accepted, the report methods do need tests. I'm 
putting this patch here in advance of any other work to get feedback on the 
flavor of tests I have given the report methods on the existing one directory 
level of dircmp testing before proceeding with any deeper testing.

The tests in this patch all pass with the existing filecmp code without adding 
any significant execution time to test_filecmp.

Any deeper testing  of dircmp will also have to not be necessarily 
comprehensive, as the permutations of test inputs start to become too 
time-consuming. setUp and tearDown may also need some refactoring for deeper 
testing.

Should adding tests for the report methods be a separate issue from this 
enhancement?

--
keywords: +patch
Added file: http://bugs.python.org/file26625/issue-15454-1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15454
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2012-07-31 Thread Chris Calloway

New submission from Chris Calloway:

The filecmp module has no tests for the following methods of the dircmp class:

report()
report_partial_closure()
report_full_closure()

The attached patch provides those tests. This issue was suggested in issue 
15454. Future plans for these tests are provided in that issue.

--
components: Tests
files: test_filecmp-1.patch
keywords: patch
messages: 167070
nosy: cbc
priority: normal
severity: normal
status: open
title: Provide test coverage for filecmp.dircmp.report methods.
versions: Python 3.3
Added file: http://bugs.python.org/file26635/test_filecmp-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



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2012-07-31 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


--
nosy: +cjerdonek
type:  - enhancement

___
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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-31 Thread Chris Calloway

Chris Calloway added the comment:

Thank you and the issue to add report method tests is issue 15518.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15454
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15518] Provide test coverage for filecmp.dircmp.report methods.

2012-07-31 Thread Chris Calloway

Chris Calloway added the comment:

 Would it be possible to structure things so that you have tests like 
 test_report(), test_report_partial_closure(), etc?

Yes, I would prefer that structure. I was just being consistent, as you said, 
with the prevailing style of the existing tests. I will provide another patch 
with tests separated into report method concerns as you suggest and I agree.

 Also, is there any reason you need to be using a regular expression as 
 opposed to an exact string match?

Yes, the setUp method uses tempfile-generated directory names (and that's 
actually one of the few good things about the existing tests). The 
tempfile-generated directory names are part of the report method output and are 
not known in advance. So we cannot construct an exact string match in advance.

--

___
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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-29 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


--
nosy: +cbc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15454
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com