For external plugin support it would be good to expose this function in tmt.utils or have a generic tmt.testing to simplify writing tests. I can try to gather some more ideas for the latter as I stumble upon them if that is the preferred approach. So far I have:
test fixture for cli_runner, maybe as tmt_cli
test fixture to initialize or read a tmt tree. How to use this might be quite tricky since most of the api and testing goes through the cli wrappers, but maybe it can be useful in the future for preparing various other steps and only testing one step :thinking:
lint helper
caplog helper (maybe can already use the base one?)
mock tmt.utils.Command.run. Probably that's the only mock helper needed?
I've found that in order to test tmt click command, we need to reset the cli invocation as: https://github.com/teemtee/tmt/blob/78742f93789da5bbc13db3713cd6de3e8f744443/tests/__init__.py#L8-L29
For external plugin support it would be good to expose this function in
tmt.utils
or have a generictmt.testing
to simplify writing tests. I can try to gather some more ideas for the latter as I stumble upon them if that is the preferred approach. So far I have:cli_runner
, maybe astmt_cli
caplog
helper (maybe can already use the base one?)tmt.utils.Command.run
. Probably that's the only mock helper needed?