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 <rep...@bugs.python.org> <http://bugs.python.org/issue23205> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com