diff --git a/visidata/basesheet.py b/visidata/basesheet.py index e10268978..4a0e80398 100644 --- a/visidata/basesheet.py +++ b/visidata/basesheet.py @@ -194,7 +194,7 @@ def execCommand(self, longname, vdglobals=None, keystrokes=None): cmd = self.getCommand(longname or keystrokes) if not cmd: - vd.warning('no command for %s' % (longname or keystrokes)) + vd.fail('no command for %s' % (longname or keystrokes)) return False escaped = False diff --git a/visidata/tests/test_commands.py b/visidata/tests/test_commands.py index 0e0c4a08d..d47a26050 100644 --- a/visidata/tests/test_commands.py +++ b/visidata/tests/test_commands.py @@ -173,6 +173,10 @@ def runOneTest(self, mock_screen, longname): sample_file = vd.pkg_resources_files(visidata) / 'tests/sample.tsv' vs = visidata.TsvSheet('test_commands', source=visidata.Path(sample_file)) + cmd = vs.getCommand(longname) + if not cmd: + vd.warning(f'command cannot be tested on TsvSheet, skipping: {longname}') + return vs.reload.__wrapped__(vs) vs.vd = vd vd.sheets = [vs]