diff --git a/kibot/layer.py b/kibot/layer.py index 4d9232ae..62791d28 100644 --- a/kibot/layer.py +++ b/kibot/layer.py @@ -189,7 +189,7 @@ class Layer(Optionable): raise KiPlotConfigurationError("Unknown layer spec: `{}`".format(layer)) new_vals.extend(ext) return new_vals - assert False, "Unimplemented layer type "+str(type(values)) # pragma: no cover (Internal) + assert False, "Unimplemented layer type "+str(type(values)) @staticmethod def _get_copper(): diff --git a/kibot/macros.py b/kibot/macros.py index dc9f850a..ae372750 100644 --- a/kibot/macros.py +++ b/kibot/macros.py @@ -33,7 +33,7 @@ def document(sentences, **kw): value = prev.value # Extract its name # variables and attributes are supported - if isinstance(target, Name): # pragma: no cover (Internal) + if isinstance(target, Name): # Note: The support for variables isn't currently used name = target.id is_attr = False @@ -65,17 +65,17 @@ def document(sentences, **kw): val = eval(unparse(value)) if isinstance(val, bool): # Not used yet - type_hint = '[boolean={}]'.format(str(val).lower()) # pragma: no cover (Internal) + type_hint = '[boolean={}]'.format(str(val).lower()) elif isinstance(val, (int, float)): # Not used yet - type_hint = '[number={}]'.format(val) # pragma: no cover (Internal) + type_hint = '[number={}]'.format(val) elif isinstance(val, str): type_hint = "[string='{}']".format(val) post_hint += '. Affected by global options' # Transform the string into an assign for _help_ID if is_attr: target = Attribute(value=Name(id='self', ctx=Load()), attr=doc_id, ctx=Store()) - else: # pragma: no cover (Internal) + else: target = Name(id=doc_id, ctx=Store()) # Reuse the s.value Str help_str = s.value @@ -102,7 +102,7 @@ def _do_wrap_class_register(tree, mod, base_class): do_import = ImportFrom(module=mod, names=[alias(name=base_class, asname=None)], level=1) return [do_import, tree, do_register] # Just in case somebody applies it to anything other than a class - return tree # pragma: no cover (Internal) + return tree def output_class(tree, **kw): diff --git a/tests/.config/kiplot/plugins/fil_test.py b/tests/.config/kiplot/plugins/fil_test.py index 9842010a..bba685c6 100644 --- a/tests/.config/kiplot/plugins/fil_test.py +++ b/tests/.config/kiplot/plugins/fil_test.py @@ -4,6 +4,19 @@ from . import log logger = log.get_logger(__name__) +with document: + avar = 1 + """ Documentation """ + bvar = True + """ Other doc """ +assert _help_avar == '[number=1] Documentation', _help_avar +assert _help_bvar == '[boolean=true] Other doc', _help_bvar + +@filter_class +def pp(): + pass + + @filter_class class Filter_Test(BaseFilter): # noqa: F821 def __init__(self): diff --git a/tests/test_plot/test_misc_2.py b/tests/test_plot/test_misc_2.py index 685c5fe9..8f3b5874 100644 --- a/tests/test_plot/test_misc_2.py +++ b/tests/test_plot/test_misc_2.py @@ -13,14 +13,14 @@ from utils import context prev_dir = os.path.dirname(prev_dir) if prev_dir not in sys.path: sys.path.insert(0, prev_dir) -from kibot.out_base import BaseOutput +from kibot.layer import Layer from kibot.pre_base import BasePreFlight +from kibot.out_base import BaseOutput from kibot.gs import GS from kibot.kiplot import load_actions, _import from kibot.registrable import RegOutput, RegFilter from kibot.misc import (MISSING_TOOL, WRONG_INSTALL, BOM_ERROR, DRC_ERROR, ERC_ERROR) from kibot.bom.columnlist import ColumnList -from kibot.layer import Layer cov = coverage.Coverage()