Exclude KiCad 6 code and enabled coverage for out_base tests.

This commit is contained in:
Salvador E. Tropea 2021-02-01 16:39:10 -03:00
parent f7826a7667
commit 10f0706482
3 changed files with 13 additions and 5 deletions

View File

@ -93,6 +93,7 @@ docker_shell:
single_test:
rm -rf pp
-$(PY_COV) run -a src/kibot --help-list-outputs > /dev/null
-$(PYTEST) --log-cli-level debug -k "$(SINGLE_TEST)" --test_dir pp
@echo "********************" Output
@cat pp/*/output.txt

View File

@ -6,7 +6,7 @@
from .gs import GS
from .kiplot import load_sch, get_board_comps_data
from .misc import Rect, KICAD_VERSION_5_99, W_WRONGPASTE
if GS.kicad_version_n >= KICAD_VERSION_5_99:
if GS.kicad_version_n >= KICAD_VERSION_5_99: # pragma: no cover (Ki6)
# New name, no alias ...
from pcbnew import FP_SHAPE, wxPoint, LSET
else:
@ -128,7 +128,7 @@ class VariantOptions(BaseOptions):
@staticmethod
def create_module_element(m):
if GS.kicad_version_n >= KICAD_VERSION_5_99:
return FP_SHAPE(m)
return FP_SHAPE(m) # pragma: no cover (Ki6)
return EDGE_MODULE(m)
@staticmethod

View File

@ -114,9 +114,16 @@ class NoGetTargets(BaseOutput):
def test_no_get_targets(caplog):
test = NoGetTargets()
test.get_targets('')
assert "Output 'Fake' (dummy) [none] doesn't implement get_targets(), plese report it" in caplog.text
# Also check the dependencies fallback
GS.sch = None
GS.sch_file = 'fake'
assert test.get_dependencies() == [GS.sch_file]
# Start coverage
cov.load()
cov.start()
test.get_targets('')
files = test.get_dependencies()
# Stop coverage
cov.stop()
cov.save()
assert "Output 'Fake' (dummy) [none] doesn't implement get_targets(), plese report it" in caplog.text
assert files == [GS.sch_file]