Skip to content
Skip to content

Code check and Unit tests

Code check is an automatic check of your code for mistakes. Unit tests runs your project's own tests. Neither one runs a backtest or says whether a strategy makes money.

Bot sandboxUpdated

Two panels in the drawer under the editor check your code. They are easy to confuse with a backtest; they are not one.

Code check: an automatic check of your code#

Each time you pause typing, the sandbox checks every Python file in your projects for mistakes, like a spell-checker for code. It lists syntax errors, undefined names and unused imports by file and line, and marks the same lines in the editor. Click a problem to open its line. It also checks that olypse.json and config.toml can be read. The tab says it in one line: “Checks your code for syntax errors and typos as you type. It never runs your strategy.”

Code check never runs your strategy and never reads market data. A clean Code check means the code can run, not that it makes or loses money.

Unit tests: your project's own tests#

Unit tests in the top bar (or ⌘ ⇧ T, Ctrl Shift T on Windows) runs the Python unit tests in your project's tests folder (files named test_*.py), in your browser, with a 60-second limit. The starter projects come with tests that check their helper functions (a signal, a risk limit, an exit price) on fixed inputs. The results show in the Unit tests tab, test by test.

Unit tests never backtest and never read market data: a test cannot call Olypse at all. Passing unit tests only mean your helper functions do what their tests say.

WhatCode checkUnit testsBacktest
Runs your codeNoYour tests onlyYes, the whole strategy
Reads market dataNoNoYes, past prices
Tells youWhere the code is wrongWhether your helpers behaveWhat the strategy would have done

The sandbox assistant also runs your tests on any change it proposes, before it shows it to you.

Still stuck? Contact support.