[New-bugs-announce] [issue23205] Unit test needed for IDLE's GrepDialog.py's findfiles()
Al Sweigart
report at bugs.python.org
Fri Jan 9 09:16:00 CET 2015
New submission from Al Sweigart:
GrepDialog.py's findfiles() method lacks a unit test.
The comments in the unit test stub in test_grep.py correctly notes that since findfiles() method does not rely on the GrepDialog class, it can be made into a function.
The attached patch does the following:
- Moves findfiles() to be a function in the GrepDialog.py module.
- Adds a unit test for findfiles()
- Adds sensible default arguments
- As suggested by the previous stub comments, findfiles() returns a generator instead of a full list
- Changes 'list' and 'dir' names since those are built-ins
- Uses os.walk() instead of reinventing it.
There were so many changes to make that I eventually just rewrote the entire findfiles function. I've checked that the new version returns the same strings as the old version.
----------
components: IDLE
files: idle_grep_findfiles_test.diff
keywords: patch
messages: 233727
nosy: Al.Sweigart
priority: normal
severity: normal
status: open
title: Unit test needed for IDLE's GrepDialog.py's findfiles()
versions: Python 3.5
Added file: http://bugs.python.org/file37652/idle_grep_findfiles_test.diff
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23205>
_______________________________________
More information about the New-bugs-announce
mailing list