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

fix: vscode debugger is not hitting breakpoints #64

Merged

Conversation

danay1999
Copy link
Collaborator

Description

Testing

Additional context

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary by GPT-4

This code is a configuration file for Visual Studio Code (VSCode) to debug Python tests. It is written in JSON format and is used to configure the debugging settings for Python tests in VSCode.

Here's a breakdown of the code:

  1. The file starts with an opening curly brace { and ends with a closing curly brace }.
  2. "version": "0.1.0" specifies the version of the configuration file.
  3. "configurations": [...] is an array containing one or more debugging configurations.
  4. Inside the configurations array, there's an object with several properties:
    • "name": "Debug Tests" gives a name to this configuration.
    • "type": "python" specifies that this configuration is for Python language.
    • "request": "launch" indicates that this configuration will launch a new debugging session.
    • "program": "${file}" tells VSCode to debug the currently opened file in the editor.
    • "purpose": ["debug-test"] is an array containing one or more purposes for this configuration, in this case, it's for debugging tests.
    • "console": "integratedTerminal" specifies that the integrated terminal should be used for input/output during debugging.
    • "justMyCode": false disables filtering out external code during debugging, allowing you to step into external libraries' code if needed.
    • "env": {...} sets environment variables for the debugging session. In this case, it sets PYTEST_ADDOPTS variable with some options to disable coverage reporting and parallel test execution.

This configuration allows you to debug Python tests in VSCode by launching a new debugging session using the specified settings.

Suggestions

  1. Add a newline at the end of the file to follow best practices and avoid potential issues with certain tools that expect a newline at the end of files.

  2. Add a brief comment at the beginning of the file explaining its purpose, for example:

// This configuration file is for debugging Python tests in VSCode.
  1. Consider adding more configurations for different use cases, such as running individual tests or running tests with coverage enabled.

With these changes, your updated launch.json file would look like this:

// This configuration file is for debugging Python tests in VSCode.
{
    "version": "0.1.0",
    "configurations": [
        {
            "name": "Debug Tests",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "purpose": [
                "debug-test"
            ],
            "console": "integratedTerminal",
            "justMyCode": false,
            "env": {
                "PYTEST_ADDOPTS": "--no-cov -n0 --dist no"
            }
        }
    ]
}

@codecov-commenter
Copy link

codecov-commenter commented May 9, 2023

Codecov Report

Merging #64 (2d6c7b2) into main (136357a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #64   +/-   ##
=======================================
  Coverage   86.78%   86.78%           
=======================================
  Files          13       13           
  Lines         401      401           
  Branches       61       61           
=======================================
  Hits          348      348           
  Misses         37       37           
  Partials       16       16           
Flag Coverage Δ
integration 83.04% <ø> (ø)
unittests 85.28% <ø> (ø)
unittests-3.10 85.28% <ø> (ø)
unittests-3.11 85.28% <ø> (ø)
unittests-3.8 85.28% <ø> (ø)
unittests-3.9 85.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

.vscode/launch.json Outdated Show resolved Hide resolved
@dciborow dciborow linked an issue May 9, 2023 that may be closed by this pull request
.vscode/settings.json Outdated Show resolved Hide resolved
.vscode/launch.json Outdated Show resolved Hide resolved
@dciborow dciborow self-requested a review May 9, 2023 14:50
@danay1999 danay1999 merged commit 52eb38d into microsoft:main May 9, 2023
@danay1999 danay1999 deleted the danay1999/configuration-for-debugger branch May 9, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: pytest-xdist breaks debugging in vscode
3 participants