Testing Framework

AI-Driven FOREX Experimentation Framework

Introduction

Even at an early stage in the project, the complexity has risen to the point that bugs cause side effects. To mitigate this, tests are being added to this project.


Test Execution

Most tests here are pytest tests. They can be executed directly by providing the path to a test file or with poetry run pytest -v to run all tests. Execute this command from the base project directory.

For the local project virtual environment, use:

aifx_venv/bin/python -m pytest tests/unit

Current unit coverage is 144 tests across tests/unit.

3rd party testing tools have also been integrated into this project:

flake8

Configuration:

- (aifx_venv) dan@sally:/opt/dev/aifx$ cat .flake8
[flake8]
max-line-length = 88
extend-ignore = E203
exclude =
    .git,
    __pycache__,
    .venv,
    aifx/ui_form.py,
    aifx/client/ui_form.py

mypy

Configuration (from pyproject.toml):

[[tool.mypy.overrides]]
module = ["plotly", "plotly.*"]
ignore_missing_imports = true

black

isort


Unit Tests


AiFxLog Tests


Fixture


BrokerDb Tests


Broker Tests


DbMgr Tests


Candle Tests


ClientDb Tests


ClientQt Cache Tests


Instrument Tests


Feed Tests


MQEvent Tests


MQClient Tests


MQMsg Tests


MQServer Tests


MQMsgBatch Tests


MQUtils Tests


OandaMgr Tests


RecentCandlesModel Tests