def test_clusterplot(tmpdir): main([ 'clusterplot', '-m', '10', datapath('clusterplot.tab.gz'), str(tmpdir) ]) assert tmpdir.join('IGHV1-1801.png').check()
def _run(args, expected): """ Run IgDiscover, redirecting stdout to a temporary file. Then compare the output with the contents of an expected file. """ outpath = str(tmpdir.join('output')) print('Running:', ' '.join(args)) with open(outpath, 'w') as f: old_stdout = sys.stdout sys.stdout = f main(args) sys.stdout = old_stdout assert files_equal(expected, outpath)
def run(args, expected): """ Run IgDiscover, redirecting stdout to a temporary file. Then compare the output with the contents of an expected file. """ with TemporaryDirectory() as td: outpath = os.path.join(td, 'output') print('Running:', ' '.join(args)) with open(outpath, 'w') as f: old_stdout = sys.stdout sys.stdout = f main(args) sys.stdout = old_stdout assert files_equal(expected, outpath)
def test_main(): with pytest.raises(SystemExit) as exc: main(['--version']) assert exc.value.code == 0
def test_main(): with assert_raises(SystemExit) as exc: main(['--version']) assert exc.exception.code == 0