Skip to content

Glossary: Refactoring and Clean Code

capsys

Also written: capsys.readouterr

A pytest fixture that captures what a test prints instead of showing it. `capsys.readouterr().out` returns the printed text as one string.

Where the book teaches it

Related terms

Golden masterfixture (pytest)