def test_showfiles_default(capsys): filenames = (tempfile.NamedTemporaryFile(), ) filenames[0].write(b'abc') filenames[0].flush() headers = ('', ) wtitle = '' pager = '' captured = capsys.readouterr() callbacks.showfiles(tuple(x.name for x in filenames), headers, wtitle, pager) captured.out.endswith('---')
def test_showfiles_default(capsys): with tempfile.NamedTemporaryFile(delete=False) as tmp: tmp.write(b'abc') tmp.close() filenames = (tmp, ) headers = ('', ) wtitle = '' pager = '' captured = capsys.readouterr() callbacks.showfiles(tuple(x.name for x in filenames), headers, wtitle, pager) captured.out.endswith('---') os.unlink(tmp.name)