-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests: sort custom loaded tests #1851
Conversation
test/worlds/__init__.py
Outdated
suite.addTests(loader.discover(folder, top_level_dir=file_path)) | ||
for test_collection in loader.discover(folder, top_level_dir=file_path): | ||
for test_suite in test_collection: | ||
for test_case in test_suite: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this use all_tests.extend(test_suite) to avoid one level of nesting?
test/worlds/__init__.py
Outdated
@@ -8,7 +8,13 @@ def load_tests(loader, standard_tests, pattern): | |||
suite.addTests(standard_tests) | |||
folders = [os.path.join(os.path.split(world.__file__)[0], "test") | |||
for world in AutoWorldRegister.world_types.values()] | |||
all_tests = [] | |||
for folder in folders: | |||
if os.path.exists(folder): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would invert this if due to the very high nesting in this section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good, assuming you tested
What is this fixing or adding?
Sorts tests by folder, resulting in less categories created from our custom loader. Possibly only visible in PyCharm?
How was this tested?
If this makes graphical changes, please attach screenshots.
turns
into