-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Addressing some unit test warnings #3222
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
base: master
Are you sure you want to change the base?
Conversation
|
|
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.
Pull request overview
This PR addresses various unit test warnings by improving resource cleanup, updating test fixtures, and pinning dependency versions.
- Properly implements cleanup logic for TCP and FTP contacts to prevent resource warnings
- Updates mock setup for async methods and removes deprecated event_loop fixture usage
- Improves FTP test robustness with better directory handling
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| app/contacts/contact_tcp.py | Adds proper cleanup methods with task cancellation and session closure handling for TCP contact server |
| app/contacts/contact_ftp.py | Simplifies FTP server startup by removing Python version-specific code paths and adds stop method |
| tests/contacts/test_contact_ftp.py | Uses test-specific directory name and shutil.rmtree for non-empty directory cleanup |
| tests/services/test_data_svc.py | Updates async mock setup to use return_value=None instead of async_mock_return helper |
| tests/conftest.py | Removes deprecated event_loop fixture parameter from async fixtures |
| tests/api/v2/test_knowledge.py | Removes deprecated event_loop fixture parameter from async fixture |
| requirements.txt | Pins pyasn1 to version 0.5.x to address related warnings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|







Description
orderedoption in Meta subclassType of change
How Has This Been Tested?
Ran unit tests locally
Ran manx agent with TCP contact to verify functionality still intact, verified server closed with dead and live manx sessions
Ran sandcat agent with FTP contact to verify functionality still intact
Checklist: