-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow for setting up a debug configuration for tests #332
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
Comments
@lmazuel this is possible today.
Please note, this is only an example, all you need to do is add "debugOptions": [
"RedirectOutput","DebugStdLib"
], Please let me know how this goes. |
Aah, you're debugging a unit test. That's new information. |
Sorry, didn't realize it was relevant information :/ I tried using the "Python" launcher and it works! At least I have a workaround when needed in the meantime. Thanks! |
No worries, at least we got to the bottom of it very quickly. Would have been a another story if you hadn't sent the screen shots. lol. Will keep you posted. |
Hey @brettcannon quite sometime since its closed Asked it on StackOverflow but no responses https://stackoverflow.com/questions/52867639/vscode-python-debug-with-unit-tests Thanks! |
@tzookb this issue is actually still open so I'm not sure what you're referring to as "closed". As for debugging a test, you can always click the "Debug Test" code lens for discovered tests. This issue is about setting up specific |
Check launch.json for the existence of a debug configuration named "Python: Unit Tests", if it exists, use it, if not generate an in-memory one as we do today. Document a sample launch.json for providing additional unit test settings, including: setting environment variables, enable debugStdLib. See src/client/unittests/common/debugLauncher.ts. |
Created a section in {
"type": "python",
"request": "test",
"name": "wow",
"env": {
"HELLO": "HMM"
}
} Got the following error in VSC: |
Environment data
VS Code version: 1.18.1
Python Extension version: 0.8.0
Python Version: 3.6
OS and version: Windows 10 falls update
Actual behavior
"Step into" when debugging does not let me go inside a lib installed in the venv (not the current personal code)
Expected behavior
"Step into" let me step into whatever code (mine or dependencies).
Steps to reproduce:
requests.get
Logs
N/A
PTVS has an option for that, and possible in PyDev (but full disclosure it was a long time ago for this one...)
The text was updated successfully, but these errors were encountered: