Skip to content

Commit

Permalink
Test that CLIs emit no warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Oct 14, 2024
1 parent b76f6db commit 3fc396a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
4 changes: 0 additions & 4 deletions histomicstk/cli/SeparateStainsXuSnmf/SeparateStainsXuSnmf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,4 @@
<default>256</default>
</integer>
</parameters>
<parameters>
<label>IO</label>
<description>Input/output parameters.</description>
</parameters>
</executable>
19 changes: 19 additions & 0 deletions tests/test_cli_xml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os
from pathlib import Path

import pytest

cliDir = Path(__file__).parent / '..' / 'histomicstk' / 'cli'
xmlList = {
cli: cliDir / cli / f'{cli}.xml' for cli in os.listdir(cliDir)
if (cliDir / cli).is_dir() and (cliDir / cli / f'{cli}.xml').is_file()
}


@pytest.mark.parametrize('cli', xmlList.keys())
def testXMLParsing(cli, caplog):
import slicer_cli_web

slicer_cli_web.CLIArgumentParser(xmlList[cli])
for record in caplog.records:
assert record.levelname not in {'WARNING', 'ERROR'}

0 comments on commit 3fc396a

Please sign in to comment.