Hello! Is it posssible to test custom bench commands? Anybody have good examples for it?)
Hi,
We do have a bit of documentation on this. You can check it out here.
Basically, you just need to import click
in the file that you need to create a command from. Note that this doesn’t really have to be commands.py as stated in the documentation. Just make sure that wherever this is being put is imported in the respective directory’s __init__.py
.
Then you may follow the click documentation and make the command do whatever you want it to.
In the end when you’re done adding commands, just make sure to add a list of commands in the file where you have the commands defined, something like this:
commands = [command_method]
wherein command_method
is the method name for the command that you have defined. It should then be picked up by bench when you run bench --help
.
Hope this helps!