Can I debug with python debugger when using py.test somehow?

it’s real simple: put an assert 0 where you want to start debugging in your code and run your tests with:

py.test --pdb 

done 🙂

Alternatively, if you are using pytest-2.0.1 or above, there also is the pytest.set_trace() helper which you can put anywhere in your test code. Here are the docs. It will take care to internally disable capturing before sending you to the pdb debugger command-line.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)