-
Notifications
You must be signed in to change notification settings - Fork 3
Add additional tests to improve coverage #464
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,11 +13,27 @@ def resource_dict(resource_dict): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class TestExecutorBackend(unittest.TestCase): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def test_meta_executor_serial(self): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def test_meta_executor_serial_with_dependencies(self): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with Executor( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| max_cores=2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backend="local", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| block_allocation=False, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disable_dependencies=True, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) as exe: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cloudpickle_register(ind=1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fs_1 = exe.submit(calc, 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fs_2 = exe.submit(calc, 2) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.assertEqual(fs_1.result(), 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.assertEqual(fs_2.result(), 2) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.assertTrue(fs_1.done()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.assertTrue(fs_2.done()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+16
to
+30
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Method name contradicts the test configuration The method name - def test_meta_executor_serial_with_dependencies(self):
+ def test_meta_executor_serial_disabled_dependencies(self):📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def test_meta_executor_serial_without_dependencies(self): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with Executor( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| max_cores=2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backend="local", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| block_allocation=False, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disable_dependencies=False, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) as exe: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cloudpickle_register(ind=1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fs_1 = exe.submit(calc, 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
🛠️ Refactor suggestion
Consider enhancing test coverage with additional cases.
While the current test covers basic error handling, consider adding:
Here's a suggested enhancement:
📝 Committable suggestion