Code style fixes (flake8)
This commit is contained in:
parent
4538163e7e
commit
2d55859782
|
|
@ -1,5 +1,5 @@
|
|||
from mymacros import macros, document # noqa: F401
|
||||
from mcpyrate.debug import macros, step_expansion
|
||||
from mcpyrate.debug import macros, step_expansion # noqa: F401,F811
|
||||
|
||||
|
||||
with step_expansion["dump"]:
|
||||
|
|
@ -19,9 +19,9 @@ class d(object):
|
|||
self.at1 = 4.5
|
||||
""" documenting d.at1 """ # <--- Not covered?
|
||||
|
||||
|
||||
print("a = "+str(a)+" # "+_help_a) # noqa: F821
|
||||
print("b = "+str(b)+" # "+_help_b) # noqa: F821
|
||||
print("c = "+str(c)+" # "+_help_c) # noqa: F821
|
||||
e = d()
|
||||
print("e.at1 = "+str(e.at1)+" # "+e._help_at1) # noqa: F821
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ def document(tree, **kw):
|
|||
else:
|
||||
target = Name(id=doc_id, ctx=Store())
|
||||
help_str = s.value
|
||||
help_str.s=type_hint+s.value.s
|
||||
help_str.s = type_hint+s.value.s
|
||||
tree[n] = Assign(targets=[target], value=help_str)
|
||||
# Copy the line number from the original docstring
|
||||
copy_location(target, s)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@ from .bom.bom import do_bom
|
|||
from .var_kibom import KiBoM
|
||||
from .fil_base import BaseFilter, apply_exclude_filter, apply_fitted_filter, apply_fixed_filter, reset_filters
|
||||
from . import log
|
||||
from .mcpyrate.debug import macros, step_expansion
|
||||
# To debug the `with document` we can use:
|
||||
# from .mcpyrate.debug import macros, step_expansion
|
||||
# with step_expansion:
|
||||
|
||||
logger = log.get_logger(__name__)
|
||||
VALID_STYLES = {'modern-blue', 'modern-green', 'modern-red', 'classic'}
|
||||
|
|
@ -37,7 +39,6 @@ class BoMColumns(Optionable):
|
|||
def __init__(self):
|
||||
super().__init__()
|
||||
self._unkown_is_error = True
|
||||
# with step_expansion:
|
||||
with document:
|
||||
self.field = ''
|
||||
""" Name of the field to use for this column """
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ prev_dir = os.path.dirname(prev_dir)
|
|||
if prev_dir not in sys.path:
|
||||
sys.path.insert(0, prev_dir)
|
||||
from kibot.misc import (EXIT_BAD_ARGS, EXIT_BAD_CONFIG, NO_PCB_FILE, NO_SCH_FILE, EXAMPLE_CFG, WONT_OVERWRITE, CORRUPTED_PCB,
|
||||
PCBDRAW_ERR, WRONG_INSTALL)
|
||||
PCBDRAW_ERR)
|
||||
|
||||
|
||||
POS_DIR = 'positiondir'
|
||||
|
|
@ -472,6 +472,8 @@ def test_pcbdraw_fail():
|
|||
ctx.clean_up()
|
||||
|
||||
|
||||
# This test was designed for `mcpy`.
|
||||
# `mcpyrate` can pass it using Python 3.8.6, but seems to have problems on the docker image
|
||||
def test_import_fail():
|
||||
ctx = context.TestContext('test_import_fail', '3Rs', 'pre_and_position', POS_DIR)
|
||||
# Create a read only cache entry that we should delete
|
||||
|
|
@ -481,7 +483,7 @@ def test_import_fail():
|
|||
os.chmod(cache_file, stat.S_IREAD)
|
||||
os.chmod(cache_dir, stat.S_IREAD | stat.S_IEXEC)
|
||||
try:
|
||||
# mcpyrate: not a problem
|
||||
# mcpyrate: not a problem, for Python 3.8.6
|
||||
ret_code = 0
|
||||
# mcpy:
|
||||
# ret_code = WRONG_INSTALL
|
||||
|
|
|
|||
Loading…
Reference in New Issue