-
Notifications
You must be signed in to change notification settings - Fork 44.5k
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
Added basic spinner tests and modified spinner method docstring #2855
Added basic spinner tests and modified spinner method docstring #2855
Conversation
Coverage reportThe coverage rate went from None of the new lines are part of the tested code. Therefore, there is no coverage data about them. |
""" | ||
Code Analysis | ||
|
||
Main functionalities: | ||
The Spinner class provides a simple way to display a spinning animation while a process is running. It can be used to indicate that a process is ongoing and to provide visual feedback to the user. The class can be used as a context manager, which means that it can be used with the 'with' statement to automatically start and stop the spinner animation. | ||
|
||
Methods: | ||
- __init__(self, message: str = "Loading...", delay: float = 0.1) -> None: Initializes the Spinner class with a message to display and a delay between each spinner update. | ||
- spin(self) -> None: Spins the spinner animation while the process is running. | ||
- __enter__(self): Starts the spinner animation when used as a context manager. | ||
- __exit__(self, exc_type, exc_value, exc_traceback) -> None: Stops the spinner animation when used as a context manager. | ||
- update_message(self, new_message, delay=0.1): Updates the message displayed by the spinner animation. | ||
|
||
Fields: | ||
- spinner: An itertools.cycle object that contains the characters used for the spinner animation. | ||
- delay: The delay between each spinner update. | ||
- message: The message to display. | ||
- running: A boolean value that indicates whether the spinner animation is running. | ||
- spinner_thread: A threading.Thread object that runs the spin method in a separate thread. | ||
""" |
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.
Did you do this by hand or with a tool? If a tool, what tool?
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 used CodiumAI's VSCode Extension which came pretty handy here, and it also helped writing the unit tests!
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 feel like we are about to become very familiar with that tool
Will you update from base so I can test the code coverage tool before we merge? |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #2855 +/- ##
==========================================
+ Coverage 35.52% 36.29% +0.77%
==========================================
Files 60 60
Lines 2849 2849
Branches 471 471
==========================================
+ Hits 1012 1034 +22
+ Misses 1776 1753 -23
- Partials 61 62 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
@OmriGM would love to see some more of these come through if you have the capacity |
Background
Changes
update_message
methodDocumentation
Test Plan
PR Quality Checklist