How to integrate dape with pytest?
I've searched the web, and can not find a solution to integrate dape with pytest. Can anyone give me some ideas about the workflow for testing and debugging? Thanks.
Hey I just pushed an batteries included config that works great with pytest, so you need to use the latest commit for this to work.
It's called `debugpy-module', see screenshot for usage (note that "User Uncaught Exceptions" need to be enabled to break at assertion error).
debugpy-module :module "pytest"
Great work! Thanks for your reply! But it did not break at any assertion error or breakpoint even when the "User Uncaught Exceptions" was enabled. What was I missing?
Would you mind share some additional information?
(setq dape-debug t)- Start
debugpy-module :module "pytest" - Share the contents of
*dape-connection events*buffer
I've searched the web, and can not find a solution to integrate dape with pytest. Can anyone give me some ideas about the workflow for testing and debugging? Thanks.
Maybe take a look at test-cockpit.el which for python/pytest now supports to run the last pytest run as a dape debug session. I would like to encourage you to give it a try and give feedback.
I accidently figured out that you can use dape to debug specific test function in specific test file by simply runing this command:
debugpy-module :module "pytest" :args ["test_file_relative_path_to_base_project::test_method_name"]
Nice find @Peter-Chou added to wiki. Feel free to extend/improve wiki pytest debugging