The code-quality bot has flagged the use of loops in test functions, which is discouraged according to Google's software engineering guidelines. Complex logic in tests, such as loops and conditionals, makes tests harder to reason about and less clear. To improve test clarity and maintainability, we should refactor tests to avoid loops. Suggested approaches include:
- Using parametrized tests to eliminate loops.
- Moving complex logic into helper functions.
- Utilizing pytest fixtures for complex setup.
Reference: Don't Put Logic in Tests
Action items:
- Identify all test functions containing loops.
- Refactor these tests using the suggested approaches above.
- Ensure tests remain clear and easy to inspect after refactoring.
I created this issue for @ajwalkiewicz from #17 (comment).
Tips and commands
Getting Help
The code-quality bot has flagged the use of loops in test functions, which is discouraged according to Google's software engineering guidelines. Complex logic in tests, such as loops and conditionals, makes tests harder to reason about and less clear. To improve test clarity and maintainability, we should refactor tests to avoid loops. Suggested approaches include:
Reference: Don't Put Logic in Tests
Action items:
I created this issue for @ajwalkiewicz from #17 (comment).
Tips and commands
Getting Help