Fixes all critical warnings from test suite:
1. **DeprecationWarning: datetime.utcnow()** (anthropic_oauth.py:458)
- Replace `datetime.utcnow()` with `datetime.now(datetime.UTC)`
- Python 3.12+ deprecation, will be removed in future versions
- Affects API header debug logging
2. **RuntimeWarning: unawaited coroutine** (test_agent_loop_tool_result.py:31)
- Change `session_mgr.save = AsyncMock()` to `MagicMock()`
- Mock was async but production code is synchronous
- Affected 4 tests (tool result handling tests)
**Test Results:**
```
======================= 277 passed in 7.61s =======================
```
All RuntimeWarning and DeprecationWarning eliminated from nanobot tests.
Note: PytestCacheWarning persists due to root-owned .pytest_cache directory
(cosmetic only, run with `-p no:cacheprovider` for clean output).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Eliminates all critical warnings from the test suite by fixing deprecated APIs and incorrect test mocks.
Warnings Fixed:
Changes
1. Fix
datetime.utcnow()Deprecation (anthropic_oauth.py:458)Before:
After:
Rationale:
datetime.utcnow()deprecated in Python 3.12+2. Fix AsyncMock Test Fixture (test_agent_loop_tool_result.py:31)
Before:
After:
Rationale:
SessionManager.save()is synchronoustest_legacy_string_result,test_tool_result_output_and_error,test_tool_result_with_base64_image,test_cli_result_handlingTest Results
Before:
After:
Impact
Note
The PytestCacheWarning persists because
.pytest_cache/is owned by root. This is cosmetic only and can be eliminated by running:🤖 Generated with Claude Code