diff --git a/kibot/bom/units.py b/kibot/bom/units.py index ff28eeb7..b900a866 100644 --- a/kibot/bom/units.py +++ b/kibot/bom/units.py @@ -86,8 +86,8 @@ def get_prefix(prefix): # Unknown, we shouldn't get here because the regex matched # BUT: I found that sometimes unexpected things happend, like mu matching micro and then we reaching this code # Now is fixed, but I can't be sure some bizarre case is overlooked - logger.error('Unknown prefix, please report') # pragma: no cover (Internal) - return 1, '' # pragma: no cover (Internal) + logger.error('Unknown prefix, please report') + return 1, '' def group_string(group): # Return a reg-ex string for a list of values diff --git a/tests/test_plot/test_misc_2.py b/tests/test_plot/test_misc_2.py index 0593da9a..d4769f20 100644 --- a/tests/test_plot/test_misc_2.py +++ b/tests/test_plot/test_misc_2.py @@ -22,6 +22,7 @@ from kibot.registrable import RegOutput, RegFilter from kibot.misc import (MISSING_TOOL, WRONG_INSTALL, BOM_ERROR, DRC_ERROR, ERC_ERROR, PDF_PCB_PRINT, CMD_PCBNEW_PRINT_LAYERS, KICAD2STEP_ERR) from kibot.bom.columnlist import ColumnList +from kibot.bom.units import get_prefix from kibot.__main__ import detect_kicad from kibot.kicad.config import KiConf @@ -268,3 +269,9 @@ def test_step_fail(test_dir, caplog, monkeypatch): assert e.type == SystemExit assert e.value.code == KICAD2STEP_ERR assert "Failed to create Step file, error 10" in caplog.text + + +def test_unknown_prefix(caplog): + with context.cover_it(cov): + get_prefix('y') + assert 'Unknown prefix, please report' in caplog.text