Skip to content

Commit 0e2182e

Browse files
committed
🐛 fix(tests): bind mock horizon into global config
Point config horizon URLs to mock_horizon during test fixture lifetime so send router checks do not leak to real Horizon and produce flaky 404 behavior in CI smoke runs.
1 parent 1da9eba commit 0e2182e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bot/tests/conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,16 @@ async def catch_all_post(request):
15011501

15021502
print(f"[MockHorizon] Started on {horizon_server_config['url']}")
15031503

1504+
from other.config_reader import config
1505+
1506+
old_horizon_url = config.horizon_url
1507+
old_horizon_url_rw = config.horizon_url_rw
1508+
config.horizon_url = horizon_server_config["url"]
1509+
config.horizon_url_rw = horizon_server_config["url"]
1510+
15041511
yield state
15051512

1513+
config.horizon_url = old_horizon_url
1514+
config.horizon_url_rw = old_horizon_url_rw
15061515
await runner.cleanup()
15071516
print("[MockHorizon] Stopped")

0 commit comments

Comments
 (0)