-
Notifications
You must be signed in to change notification settings - Fork 0
Integrated pytest #11
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
Conversation
|
I don't have too much experience with continuous integration (CI) workflow, but I think we could create a python-app.yml in actions for Python applications. |
|
Never mind, I figured it out. #12 |
|
Need to pass some checks: |
|
Could you approve #12 first? The checks are not passing so I have to refactor my codes a bit more. |
|
@samdevo Continuous integration completed, all code should work with linter and pytest |
samdevo
left a comment
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.
Nice! Some minor comments
trader/arbitrage.py
Outdated
| pool_prices.append((pool.rpc_data, price)) | ||
| print(f"Processed pool {pool.rpc_data} with price {price}") | ||
| except ValueError: | ||
| print(f"Invalid pool_price '{pool.pool_price}' in pool {pool.rpc_data}; skipping.") |
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.
Where would the ValueError come from?
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.
pytest files should start with test_* or end with *_test I believe
trader/arbitrage_tests.py
Outdated
|
|
||
| # Safely handle result | ||
| if not isinstance(result, (tuple, list)) or len(result) != 5: | ||
| pytest.fail("Invalid result format: expected 5-element sequence") |
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.
why not just use assert?
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.
fixed
|
And @ruidazeng re your question abt workflows. I think the codebase is too small right now to need workflows for testing. Maybe in the future. But if you want to add and think it's worthwhile fell free! |
Co-authored-by: Sam Devorsetz <samdevorsetz@gmail.com>
merged with passed tests! |
Can we set up a GitHub workflow for this too?