Hi,
It depends on if you are talking about unit testing in the cloud or locally and what kind of features in the algo you want to unit test.
So, in the cloud, it is not easy, or maybe even impossible to unit test. The level of control is not there to easily do it.
Locally, there are things that can be done, and it goes to the kind of features you want to unit test.
For instance, if you want to unit test your OnData() method, well, good luck 😊. You would rather be more effective doing debugging with a debugger, logging, use assertions, typing with mypy, etc.
So this is true for all methods that are heavily linked to LEAN, more or less, that are called by LEAN which feeds inputs to your algo…
But for everything else that is there to support your algo, data structures, logic, etc, that can be unit tested, locally, just like any other unit testing. You can use unittest for instance or any other Python unit testing framework.
Fred