skip to navigation
skip to content

pytest-session_to_file 0.1.2

pytest-session_to_file is a py.test plugin for capturing and saving to file the stdout of py.test.

pytest-session_to_file is a py.test plugin that save failure or test session information to a file pass that can be invoked as at command line when launching py.test run. It put in a file exactly what pytest return to stdout.


Install it with pip as follow :

pip install pytest-pytest_session_to_file


Once the plugin is installed edit your and insert in the top of the file :

pytest_plugins = ‘pytest_session_to_file’

Then you can launch your test with the new option –session_to_file= like this :

py.test –session_to_file=FILENAME

If you don’t want to edit your you can invoque py.test like this :

py.test -p pytest_session_to_file –session_to_file=FILENAME

At the end of the test execution you should obtain a text file with the content of stdout of py.test under the filename provided that look like this :

============== test session starts ====================

============== 2 passed in 34.70 seconds ==============

TODO: Write test

Inspire by: _pytest.pastebin


Platforms: All

Version: 0.1.0

Date: 30 sept. 2015 11:25

License: LGPLv3 (

Copyright (C) 2015 Richard Vézina <>

File Type Py Version Uploaded on Size
pytest-session_to_file-0.1.2.tar.gz (md5) Source 2015-10-01 2KB