Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
all_project_files(): use different paths
Sort file to make the tests more reproducible.
  • Loading branch information
vstinner committed Jun 21, 2022
commit 741a8d1e59c4298d961f9c3241b9bc936a675ce7
17 changes: 13 additions & 4 deletions Lib/test/test_lib2to3/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,19 @@ def get_refactorer(fixer_pkg="lib2to3", fixers=None, options=None):
options = options or {}
return refactor.RefactoringTool(fixers, options, explicit=True)

def all_project_files():
for dirpath, dirnames, filenames in os.walk(proj_dir):
def _all_project_files(root, files):
for dirpath, dirnames, filenames in os.walk(root):
for filename in filenames:
if filename.endswith(".py"):
yield os.path.join(dirpath, filename)
if not filename.endswith(".py"):
continue
files.append(os.path.join(dirpath, filename))

def all_project_files():
files = []
_all_project_files(lib2to3_dir, files)
_all_project_files(test_dir, files)
# Sort to get more reproducible tests
files.sort()
return files

TestCase = unittest.TestCase