Skip to content

Commit

Permalink
testing: Sort tests alphabetically
Browse files Browse the repository at this point in the history
Fixes #605.
  • Loading branch information
Makman2 committed May 30, 2015
1 parent c35c117 commit 5c3327d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions coalib/tests/TestHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ def run_tests(self, ignore_list):
number = len(self.test_files)
nonexistent_tests = 0

# Sort tests alphabetically.
self.test_files.sort(key=lambda fl: str.lower(os.path.split(fl)[1]))

for i, file in enumerate(self.test_files):

This comment has been minimized.

Copy link
@sils

sils May 30, 2015

Member

can't you just use enumerate(sorted(self.test_files)) here?

This comment has been minimized.

Copy link
@Makman2

Makman2 May 30, 2015

Member

I need to extract the right key from the files. I don't want to sort beginning with the complete path, but only the filename.
But I can inline it into the enumeration statement if you think that's better.

This comment has been minimized.

Copy link
@sils

sils May 30, 2015

Member

ah yes, sorry

self.__execute_test(file,
i+nonexistent_tests+1,
Expand Down

1 comment on commit 5c3327d

@sils
Copy link
Member

@sils sils commented on 5c3327d May 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack then

Please sign in to comment.