classification
Title: Increase filecmp test coverage from 63% to 76%
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, diana, eric.araujo, python-dev
Priority: normal Keywords: patch

Created on 2014-04-26 14:50 by diana, last changed 2014-05-04 14:44 by diana. This issue is now closed.

Files
File name Uploaded Description Edit
increase_filecmp_test_coverage.patch diana, 2014-04-26 14:50 review
increase_filecmp_test_coverage__updated_to_use_context_manager.patch diana, 2014-04-26 22:50 review
Messages (5)
msg217201 - (view) Author: diana (diana) * Date: 2014-04-26 14:50
- Increase filecmp test coverage from 63% to 76%

- I left the testing style as-is, though it could probably be modernized.

- I did not attempt to add coverage for 'funny_files', 'subdirs', etc, next pass perhaps.

- Before:

diana$ ./python.exe ../coveragepy report --show-missing
Name          Stmts   Miss  Cover   Missing
-------------------------------------------
Lib/filecmp     163     61    63%   64, 80, 126, 130, 159-161, 164-166, 172, 174, 178-180, 190-194, 197-199, 203-224, 227-230, 233-236, 246, 293-302, 305

- After:

diana$ ./python.exe ../coveragepy report --show-missing
Name          Stmts   Miss  Cover   Missing
-------------------------------------------
Lib/filecmp     163     39    76%   64, 80, 126, 130, 159-161, 164-166, 172, 174, 178-180, 192-194, 197-199, 217-218, 220-221, 223-224, 229-230, 235-236, 246, 293-302, 305

Thoughts? Thanks!
msg217211 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2014-04-26 20:38
Thanks for the patch. I think you could use the support.catpured_stdout() context-manager in _assert_report. You should also sign the contributor agreement.
msg217222 - (view) Author: diana (diana) * Date: 2014-04-26 22:50
Nice, the support.catpured_stdout() context manager is much better.

I've added a new patch with that change:

    increase_filecmp_test_coverage__updated_to_use_context_manager.patch

Thanks for reviewing this, Benjamin!

PS. I signed the contributor agreement.
msg217849 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-05-04 00:19
New changeset 57dacba9febf by Benjamin Peterson in branch '3.4':
improve test coverage of filecmp (closes #21357)
http://hg.python.org/cpython/rev/57dacba9febf

New changeset c597654a7fd8 by Benjamin Peterson in branch 'default':
merge 3.4 (#21357)
http://hg.python.org/cpython/rev/c597654a7fd8
msg217876 - (view) Author: diana (diana) * Date: 2014-05-04 14:44
Thanks Benjamin!
History
Date User Action Args
2014-05-04 14:44:38dianasetmessages: + msg217876
2014-05-04 00:19:05python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg217849

resolution: fixed
stage: patch review -> resolved
2014-04-26 22:50:11dianasetfiles: + increase_filecmp_test_coverage__updated_to_use_context_manager.patch

messages: + msg217222
2014-04-26 22:43:40dianasetfiles: - increase_filecmp_test_coverage_2.patch
2014-04-26 22:41:26dianasetfiles: + increase_filecmp_test_coverage_2.patch
2014-04-26 20:38:16benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg217211
2014-04-26 18:51:06eric.araujosetnosy: + eric.araujo
2014-04-26 15:41:06pitrousetstage: patch review
2014-04-26 14:50:05dianacreate