Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Ability to Specify Custom Profile When Debugging Tests #7131

Closed
erinxocon opened this issue Aug 28, 2019 · 3 comments
Closed

Allow Ability to Specify Custom Profile When Debugging Tests #7131

erinxocon opened this issue Aug 28, 2019 · 3 comments

Comments

@erinxocon
Copy link

Howdy all!

I will copy and and paste my question/feature from twitter to here! I am debugging some unit tests with django using ptvsd. I need to step into code from another library but I cannot due to the JustMyCode feature. I can disable it in my launch.json but I'm not sure which profile is used when I hit debug test!

My current launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Django",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/manage.py",
            "console": "integratedTerminal",
            "args": [
                "runserver",
                "0.0.0.0:8000",
                "--noreload",
                "--nothreading"
            ],
            "django": true,
            "justMyCode": false
        }
    ]
}

Debugging works just fine with this approach however when I debug a test individually I cannot step into code from other libraries due to the justMyCode restriction. I am not sure how to disable this when you are debugging tests.

I love ptvsd and it's integration with code! Fantastic work!

@erinxocon erinxocon added the triage-needed Needs assignment to the proper sub-team label Aug 28, 2019
@karthiknadig
Copy link
Member

@erinxocon Lets try a simple solution first and see if that helps. Add this to your launch json as a separate config.

        {
            "name": "Debug Unit Test",
            "type": "python",
            "request": "test",
            "justMyCode": false,
        },

The run the test as you normally do, it should pick up this setting automatically.

@erinxocon
Copy link
Author

Trying, I did add a section to my launch.json with that on the advice from @luabud but it didn't seem to work!

@erinxocon
Copy link
Author

Ok this works! I had forgot the type property, I now see the expanded call stack and I can step into the problem function when doing one off debug tests! Thank you! @luabud do you need me to put an MR/PR for any documentation around this? Thanks for the help @karthiknadig

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Aug 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants