diff -r 1f841cb8e056 Lib/unittest/loader.py --- a/Lib/unittest/loader.py Fri Apr 13 17:39:16 2012 +0100 +++ b/Lib/unittest/loader.py Fri Apr 13 22:50:19 2012 +0200 @@ -149,7 +149,7 @@ testFnNames.sort(key=functools.cmp_to_key(self.sortTestMethodsUsing)) return testFnNames - def discover(self, start_dir, pattern='test*.py', top_level_dir=None): + def discover(self, start_dir, pattern=None, top_level_dir=None): """Find and return all test modules from the specified start directory, recursing into subdirectories to find them and return all tests found within them. Only test files that match the pattern will @@ -170,6 +170,8 @@ packages can continue discovery themselves. top_level_dir is stored so load_tests does not need to pass this argument in to loader.discover(). """ + if pattern is None: + pattern = 'test*.py' set_implicit_top = False if top_level_dir is None and self._top_level_dir is not None: # make top_level_dir optional if called from load_tests in a package