Autoplugin will crash sphinx if the plugin crashes
Currently, the autoplugin sphinx plugin will crash sphinx if a minimal setup will cause the plugin being documented to crash in its init. This is because the plugin is actually executed to get some basic information. We could catch errors and try printing out a warning, though, this behavior can be a bit surprising in any case because if a plugin author does not access all the configuration variables before the init finishes or throws an exception; then not all the parameters will get documented. I don't see an easy way to "fix" this without rethinking how this is done, but maybe we can add some guidance to the auto-plugin documentation to make it less surprising.
EDIT: Examples of things that can't really be supported by autoplugin as is:
def __init__(self):
cfg1 = self.config.as_str('cfg1')
# Something that crashes if cfg doesn't have a value
cfg2 = self.config.as_Str('cfg2')
# cfg2 doesn't get documented
or
def __init__(self):
cfg1 = self.config.as_str('cfg1')
if cfg1 == 'magic':
cfg2 = self.config.as_Str('cfg2')
# cfg2 doesn't get documented
Though, personally, I would extract all the configuration values first, and then override self.startTestRun() or self.pluginsLoaded() for anything that might crash or need to sys.exit().
I think the first thing we can do is a "required" parameter to the as_int, as_list` etc. methods to say the attribute is mandatory. Then create a config method that prints all errors into stderr.
You mean something that prints all missing configuration values when nose2 is run?
When it is a "true" run, yes, and when it is autoplugin, it justs adds the notice "mandatory"