Skip to content

test(clob): avoid full-position market order cleanup#146

Merged
cesarenaldi merged 1 commit into
mainfrom
fix/clob-market-order-test-cleanup
Jul 8, 2026
Merged

test(clob): avoid full-position market order cleanup#146
cesarenaldi merged 1 commit into
mainfrom
fix/clob-market-order-test-cleanup

Conversation

@cesarenaldi

@cesarenaldi cesarenaldi commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Remove live position lookup from CLOB market-order integration tests
  • Exercise market-order placement with a minimum-size buy
  • Best-effort clean up only the accepted order's taking amount instead of selling the full reported position

Verification

  • uv run ruff format --check tests/integration/test_clob_orders.py
  • uv run ruff check tests/integration/test_clob_orders.py
  • uv run pyright tests/integration/test_clob_orders.py
  • uv run pytest tests/integration/test_clob_orders.py -m metered --collect-only -q

Live metered tests were not run locally.


Note

Low Risk
Changes are limited to integration test behavior and reduce live-test side effects; no production trading or client logic is modified.

Overview
Metered CLOB market-order integration tests no longer call list_positions or sell an entire reported position before exercising placement.

Both async and sync tests now always place a minimum-size FAK buy, assert an AcceptedOrder, and only best-effort sell response.taking_amount when it is greater than zero (errors suppressed). The Position import and _find_owned_token_position helper are removed.

Reviewed by Cursor Bugbot for commit 2803434. Bugbot is set up for automated code reviews on this repo. Configure here.

@cesarenaldi cesarenaldi merged commit e6cdb8d into main Jul 8, 2026
7 checks passed
@cesarenaldi cesarenaldi deleted the fix/clob-market-order-test-cleanup branch July 8, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant