Created
January 16, 2019 08:22
-
-
Save 0x49D1/ef82b8b97de839468446b3c079371804 to your computer and use it in GitHub Desktop.
Want print information with "print" statements in pytest? See the sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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