You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Look into test debugging stability/configuration #174
In my workspace, I have tests/test_hello.py with the following
importunittestdefhello():
return'Here is my test file'classTestHello(unittest.TestCase):
deftest_hello(self):
self.assertEqual(hello(), 'Here is my test file')
if__name__=='__main__':
unittest.main()
Now, I have tests/test_hello.py with the following
importunittestdefhello():
return'Here is my test file'classTestHello(unittest.TestCase):
deftest_hello(self):
self.assertEqual(hello(), 'Here is my test file')
foriinrange(5):
print(i)
self.assertEqual(i, i)
if__name__=='__main__':
unittest.main()
Paula helped me fix my .vscode/launch.json file to the following:
{
// 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: Debug Tests",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"purpose": ["debug-test"],
"console": "integratedTerminal",
"justMyCode": true,
"env": {
"PYTHONPATH": "${workspaceFolder}"
}
}
]
}
I was able to verify the issue successfully after that.
Activity
Use python debugger in testing (#22903)
paulacamargo25 commentedon Feb 23, 2024
Verification steps:
type: debugpy, like this onerzhao271 commentedon Feb 23, 2024
In my workspace, I have
tests/test_hello.pywith the followingIn
.vscode/launch.json, I have the following{ "name": "Python: Debug Tests", "type": "debugpy", "request": "launch", "program": "${file}", "purpose": ["debug-test"], "console": "integratedTerminal", "justMyCode": true, "env": { "PYTHONPATH": "${workspaceFolder}" } }Nothing happens when I press the "Debug using launch.json" option.
rzhao271 commentedon Feb 23, 2024
Now, I have
tests/test_hello.pywith the followingPaula helped me fix my
.vscode/launch.jsonfile to the following:{ // 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: Debug Tests", "type": "debugpy", "request": "launch", "program": "${file}", "purpose": ["debug-test"], "console": "integratedTerminal", "justMyCode": true, "env": { "PYTHONPATH": "${workspaceFolder}" } } ] }I was able to verify the issue successfully after that.
Merged PR posit-dev/positron-python#395: Merge upstream: `v2024.2.0`
Merged PR posit-dev/positron-python#395: Merge upstream: `v2024.2.0`