feat(endcycle-sniper): add unit test suite and fix datetime deprecation#9
Open
b5119 wants to merge 1 commit intoGabagool2-2:mainfrom
Open
Conversation
- Add tests/ with 26 passing unit tests for BotStats and ArbitrageBot - Tests use sys.modules mocking — no credentials or network required - Fix datetime.utcnow() deprecated in Python 3.12+ across bot.py - Fix offset-naive/aware inconsistency introduced by the deprecation fix - pyproject.toml already declared pytest deps + testpaths but had no tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
tests/directory with 26 unit tests forBotStatsand
ArbitrageBotin the endcycle-sniper-bot moduledatetime.utcnow()which is deprecated in Python 3.12+TypeErrorin_log_stats()and
get_stats()Why
pyproject.tomlalready declaredpytestin dev deps andtestpaths = ["tests"]but the folder didn't exist.Running on Python 3.12 also surfaces 29 deprecation warnings
from
datetime.utcnow()— all now resolved.Tests
26 passed, 0 warnings ✅
No credentials or network access required to run.