diff --git a/kibot/config_reader.py b/kibot/config_reader.py index bcce50ae..934ac4e5 100644 --- a/kibot/config_reader.py +++ b/kibot/config_reader.py @@ -316,7 +316,7 @@ def print_preflights_help(): for n, o in OrderedDict(sorted(pres.items())).items(): help, options = o.get_doc() if help is None: - help = 'Undocumented' # pragma: no cover (Internal) + help = 'Undocumented' print('- {}: {}.'.format(n, help.strip())) if options: print_output_options(n, options, 2) diff --git a/tests/.config/kiplot/plugins/pre_test.py b/tests/.config/kiplot/plugins/pre_test.py new file mode 100644 index 00000000..009f9ae1 --- /dev/null +++ b/tests/.config/kiplot/plugins/pre_test.py @@ -0,0 +1,12 @@ +from kibot.macros import macros, pre_class # noqa: F401 +from .log import get_logger + +logger = get_logger(__name__) + + +@pre_class +class Pre_Test(BasePreFlight): # noqa: F821 + def __init__(self, name, value): + super().__init__(name, value) + self._enabled = value + self._pcb_related = True diff --git a/tests/test_plot/test_misc.py b/tests/test_plot/test_misc.py index 6037d94d..5f605783 100644 --- a/tests/test_plot/test_misc.py +++ b/tests/test_plot/test_misc.py @@ -382,6 +382,16 @@ def test_help_output_plugin_2(test_dir, monkeypatch): ctx.clean_up() +def test_help_output_plugin_3(test_dir, monkeypatch): + ctx = context.TestContext(test_dir, 'test_help_output_plugin_3', '3Rs', 'pre_and_position', POS_DIR) + with monkeypatch.context() as m: + m.setenv("HOME", os.path.join(ctx.get_board_dir(), '../..')) + logging.debug('HOME='+os.environ['HOME']) + ctx.run(extra=['--help-preflights'], no_verbose=True, no_out_dir=True, no_yaml_file=True, no_board_file=True) + assert ctx.search_out('- pre_test: Undocumented') + ctx.clean_up() + + def test_help_outputs(test_dir): ctx = context.TestContext(test_dir, 'HelpOutputs', '3Rs', 'pre_and_position', POS_DIR) ctx.run(extra=['--help-outputs'], no_verbose=True, no_out_dir=True, no_yaml_file=True, no_board_file=True)