Skip to content

Commit f3903c7

Browse files
committed
file
1 parent 9dcc653 commit f3903c7

File tree

3 files changed

+22
-179
lines changed

3 files changed

+22
-179
lines changed

.github/workflows/test-metatrader5-integration.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ jobs:
6565
- name: Install MetaTrader5 Python package
6666
run: pip install MetaTrader5
6767

68-
- name: Run Python inline script
69-
shell: pwsh
70-
run: |
71-
python -c "import MetaTrader5 as mt5; import time; import sys; print('Testing MT5 initialization...'); success = False;"
7268

69+
- name: Run MT5 test script
70+
run: python tests/integration/test_mt5_connection.py

test/integration/test_mt5_initialization.py

Lines changed: 0 additions & 175 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import MetaTrader5 as mt5
2+
import time
3+
import sys
4+
5+
print('Testing MT5 initialization...')
6+
7+
success = False
8+
for attempt in range(12):
9+
if mt5.initialize():
10+
print('MT5 initialized successfully')
11+
mt5.shutdown()
12+
success = True
13+
break
14+
else:
15+
print(f'Attempt {attempt+1}: Not ready yet, sleeping...')
16+
time.sleep(5)
17+
18+
if not success:
19+
print('Failed to initialize MT5 after waiting.')
20+
sys.exit(1)

0 commit comments

Comments
 (0)