PySnooper
PySnooper copied to clipboard
Add support for infinite depth tracing and fix pytest warning
Description:
This pull request introduces two improvements to the codebase:
- Infinite depth support: Added support for infinite depth function call tracing by allowing the depth parameter to be set to float('inf'). This enables tracing of recursive functions without a predefined depth limit. A new test case, test_infinite_depth_support.py, has been added to verify the correct behavior of this feature.
- Fix pytest warning: Modified the current_thread.getName() call to current_thread.name to avoid pytest warnings. Updated the thread_info variable assignment accordingly:
thread_info = "{ident}-{name} ".format(
ident=current_thread.ident, name=current_thread.name)
- Optimization for large depth values: Updated the frame tracing code to prevent tracing of imported libraries when a large depth value is provided. This helps avoid unnecessary tracing and improves performance.
Please review the changes and let me know if you have any questions or suggestions.
Thank you, but please separate the 3 issues into 3 separate PRs. You could either do them in parallel, or wait to finish with one before continuing the other, whichever is more convenient for you. Then I'll review.
Ok, Thanks, will do that!