mfussenegger / nvim-dap-python

An extension for nvim-dap, providing default configurations for python and methods to debug individual test methods or classes.
GNU General Public License v3.0
571 stars 50 forks source link

[Feature Request] `test_file`, `test_dir` & `test_all` #122

Closed Rizhiy closed 10 months ago

Rizhiy commented 10 months ago

Would be great if test_file, test_dir and test_all methods were added.

mfussenegger commented 10 months ago

You can create your own configuration entries for that. E.g, create a .vscode/launch.json like the following, or extend tthe dap.configurations.python list.

{
   "version": "0.2.0",
   "configurations": [
       {
           "type": "python",
           "request": "launch",
           "name": "Test all",
           "module": "pytest"
       },
       {
           "type": "python",
           "request": "launch",
           "name": "Test file",
           "module": "pytest",
           "args": [
             "${file}"
           ]
       }
   ]
}

Imho it's not worth having this built-in. test_class and test_method are different because they require figuring out the context.

Rizhiy commented 10 months ago

Thanks