You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling Command.run directly leaves the main code path that's actually used untested, cf. gh-298
It could be useful to test the whole stack and use the actual command line parser for launching commands in the tests. It's probably possible to write a small helper function that takes a conf object etc. plus command line arguments, and uses those to launch commands.
The text was updated successfully, but these errors were encountered:
The outermost run method is Command.run_from_args(), which looks looks like this (except update and quickstart, which map to Command.run()):
@classmethoddefrun_from_args(cls, args):
from ..plugin_managerimportplugin_managerconf=config.Config.load(args.config)
forplugininconf.plugins:
plugin_manager.import_plugin(plugin)
returncls.run_from_conf_args(conf, args)
The issues I see are:
Every test will be reading args.config from disk, which will require some tempdir creation/cleanup logic.
More critically, every test will be importing anything included in conf.plugins, which could make testing behavior dependent upon presence/absence of particular plugins tricky.
Calling
Command.run
directly leaves the main code path that's actually used untested, cf. gh-298It could be useful to test the whole stack and use the actual command line parser for launching commands in the tests. It's probably possible to write a small helper function that takes a conf object etc. plus command line arguments, and uses those to launch commands.
The text was updated successfully, but these errors were encountered: