python - pytest: printing from fixture -
i'm writing tests using pytest. have fixture this:
@pytest.yield_fixture(autouse=true, scope='session') def manage_tests(): print("do stuff...") do_stuff() yield
i put print statement there see in console when i'm running tests, better visibility program doing. don't see text in console, i'm guessing pytest swallows it. there way print fixture?
pytest doesn't not swallow output, it's not shown default. see output in console, try running test -s
option, like:
pytest -s <path_to_file>
Comments
Post a Comment