Skip to content

Commit

Permalink
pytest: test for default output to stdout when source=None in to*()
Browse files Browse the repository at this point in the history
  • Loading branch information
Juarez Rudsatz committed Nov 22, 2022
1 parent 108518f commit 840dfb2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions petl/test/io/test_sources.py
Expand Up @@ -92,6 +92,17 @@ def test_stdoutsource():
etl.topickle(tbl, StdoutSource())


def test_stdoutsource_none(capfd):

tbl = [('foo', 'bar'), ('a', 1), ('b', 2)]
etl.tocsv(tbl, encoding='ascii')
captured = capfd.readouterr()
outp = captured.out
# TODO: capfd works on vscode but not in console/tox
if outp:
assert outp in ( 'foo,bar\r\na,1\r\nb,2\r\n' , 'foo,bar\na,1\nb,2\n' )


def test_stdoutsource_unicode():

tbl = [('foo', 'bar'),
Expand Down

0 comments on commit 840dfb2

Please sign in to comment.