Skip to content

Instantly share code, notes, and snippets.

@0x49D1
Created January 16, 2019 08:22
Show Gist options
  • Save 0x49D1/ef82b8b97de839468446b3c079371804 to your computer and use it in GitHub Desktop.
Save 0x49D1/ef82b8b97de839468446b3c079371804 to your computer and use it in GitHub Desktop.
Want print information with "print" statements in pytest? See the sample
#!/usr/bin/python
"""
Run the script like: $ pytest -s test_stdout_stderr.py
-s shortcut for --capture=no
"""
import sys
def test_hello():
print("hello testing")
print("stderr during testing", file=sys.stderr)
assert True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment