User Tools

Site Tools


pytest_notes

test a script that prints to stdout

snippet 1:

captured = capsys.readouterr()
...
assert captured.out == output_expected

snippet 2:

out, error = capsys.readouterr()

run pytest on the current file from the current file

pytest_notes.txt · Last modified: 2021/01/08 00:13 by raju