Testing

CI initializes against binance.us, not binance.com

Id: d4ff6265-1661-4e71-9e26-1048a4088bb0 Type: workaround Status: active Evidence: confirmed Source: commit 050284a See: https://github.com/oliver-zehentleitner/unicorn-binance-trailing-stop-loss — edbe20a8-50ce-4e7a-9d72-94c80c60838f — as of 2026-09-28

BinanceRestApiManager.__init__() makes a live get_server_time() call against Binance for every exchange. Test classes that need to exercise a binance.com-specific endpoint initialize the manager with exchange="binance.us" and then manually override the relevant URL constants (e.g. PAPI_URL, OPTIONS_URL) for the endpoint actually under test, instead of initializing with exchange="binance.com" directly.

Reason: GitHub Actions runners are US-based, and Binance blocks binance.com API access from restricted (US) locations — a direct binance.com init would fail in CI (though it may work fine locally, outside the US). This is the same workaround pattern used in UBWA’s and UBTSL’s unit tests, for the same reason.

How to apply: don’t “fix” a test by switching its init back to binance.com because it looks more correct — it will pass locally and fail in CI.

colorama.init(wrap=False)

Id: 153a6b4b-402c-4b16-afb7-dd659bf9f351 Type: workaround Status: active Evidence: confirmed Source: commit f8bb80c

colorama.init() is called with wrap=False.

Reason: colorama.init() wraps sys.stdout/sys.stderr with AnsiToWin32, which overrides isatty(). If BinanceRestApiManager is instantiated more than once in the same process (e.g. in tests, or a host app creating multiple managers), the stream gets wrapped again on each init, and isatty() ends up calling itself recursively until RecursionError. wrap=False avoids the repeated wrapping.