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

Unable to disable justMyCode in Test Debugging #207

Closed
roman-anna-money opened this issue Feb 9, 2024 · 1 comment
Closed

Unable to disable justMyCode in Test Debugging #207

roman-anna-money opened this issue Feb 9, 2024 · 1 comment
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@roman-anna-money
Copy link

roman-anna-money commented Feb 9, 2024

Type: Bug

Behaviour

Expected vs. Actual

I tried several ways to disable justMyCode, but unfortunately none of them worked for tests.

  1. I added "debugpy.debugJustMyCode": false to my settings
  2. I configured .vscode/launch.json as follows:
{
  "version": "0.2.0",
  "configurations": [
    {
        "name": "Python: Debug Tests",
        "type": "debugpy",
        "request": "launch",
        "program": "${file}",
        "purpose": ["debug-test"],
        "console": "integratedTerminal",
        "justMyCode": false,
        "logToFile": true
    }
  ]
}

Unfortunately, these settings don't seem to affect the "Debug Tests" feature, including UI buttons in the Testing tab and the "Debug Test at Cursor" / "Debug Tests in Current File" menu options.

When using the standard "Start Debugging" option, both the default and the custom configuration (if specified directly) work. Additionally, "logToFile": true also doesn't apply to tests, but works for normal run, suggesting that the configuration might be completely ignored for tests.

Moving these settings to a .code-workspace file doesn't help.

Steps to reproduce:

The sample project consists of a single file and configured to use pytest, python 3.12.1:

import logging

logger = logging.getLogger()

def test_test():
    logger = logging.getLogger()

The debugger doesn't step into any of these logging.getLogger() when run as test, and successfully does it if run directly.

When the debugger skips a step-in, the notification appears:

Frame skipped from debugging during step-in.
Note: may have been skipped because of "justMyCode" option (default == true). Try setting "justMyCode": false in the debug configuration (e.g., launch.json).

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.1
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

Extension version: 2024.1.10391007
VS Code version: Code 1.86.1 (Universal) (31c37ee8f63491495ac49e43b8544550fbae4533, 2024-02-07T09:09:01.236Z)
OS version: Darwin arm64 23.3.0
Modes:

System Info
Item Value
CPUs Apple M1 Pro (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 19, 13, 10
Memory (System) 16.00GB (0.05GB free)
Process Argv --crash-reporter-id c7f5d3df-8d78-4fad-aba9-433aa816b103
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyonecf:30548226
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
b5d27386:30958190
3ef8e399:30949928

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 9, 2024
@roman-anna-money roman-anna-money changed the title Can't turn off justMyCode in tests Unable to disable justMyCode in Test Debugging Feb 9, 2024
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Feb 9, 2024
@paulacamargo25
Copy link
Contributor

Closing as duplicate of: #112

@paulacamargo25 paulacamargo25 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

3 participants