Skip to content
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

refactor: improve test readability #21

Merged
merged 19 commits into from
Jul 26, 2024
Merged

refactor: improve test readability #21

merged 19 commits into from
Jul 26, 2024

Conversation

athith-g
Copy link
Collaborator

@athith-g athith-g commented Jul 19, 2024

Adds a timeout decorator to test_tasks.py and refactors fixtures and test to make them more readable.

Summary by Sourcery

Refactored test_tasks.py to use a timeout decorator for enforcing time limits on task completion and file download functions, improving code readability and maintainability.

  • Enhancements:
    • Introduced a timeout decorator to enforce a time limit on specific functions in test_tasks.py.

Copy link

sourcery-ai bot commented Jul 19, 2024

Reviewer's Guide by Sourcery

This pull request introduces a timeout decorator to the test_tasks.py file. The decorator is used to enforce a time limit on functions, replacing the previous manual timeout checks. The get_task_state and test_task functions have been refactored to use this new decorator, simplifying the code and ensuring consistent timeout handling.

File-Level Changes

Files Changes
tests/tasks/test_tasks.py Introduced a timeout decorator and refactored existing functions to use this decorator for enforcing time limits.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @athith-g - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue found
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

tests/tasks/test_tasks.py Outdated Show resolved Hide resolved
tests/tasks/test_tasks.py Outdated Show resolved Hide resolved
tests/tasks/test_tasks.py Show resolved Hide resolved
tests/tasks/test_tasks.py Outdated Show resolved Hide resolved
tests/tasks/test_tasks.py Show resolved Hide resolved
@uniqueg
Copy link
Member

uniqueg commented Jul 25, 2024

Also, I think that you'd probably need to rename the PR title ;-)

@athith-g athith-g changed the title refactor: use signal decorator for timeouts refactor: improve test readability Jul 25, 2024
@athith-g athith-g merged commit 2d627da into main Jul 26, 2024
1 check passed
@athith-g athith-g deleted the add_timeout_decorator branch July 26, 2024 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants