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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -