Skip to content

Default to --capture=no when debugging pytest #19322

Closed

Description

From the discussion on StackOverflow, this is due to microsoft/debugpy#899 (comment). So it seems that VSCode should default to --capture=no when debugging pytest.

Originally posted by Pavel Minaev (@int19h) in microsoft/debugpy#947 (comment)

Activity

  1. harupy commented on Sep 24, 2022

    @harupy

    Karthik Nadig (@karthiknadig) Can I work on this issue?

  2. karthiknadig commented on Sep 27, 2022

    @karthiknadig
    MemberAuthor
  3. zljubisic commented on Oct 10, 2022

    @zljubisic

    I don't know why we need default to --capture=no, because if we set it in settings.json:

    {
        "python.testing.pytestArgs": [
            "tests",
            "--no-cov",
            "--capture=no"
        ],
        "python.testing.unittestEnabled": false,
        "python.testing.pytestEnabled": true,
        "testing.defaultGutterClickAction": "debug"
    }
    

    even you can see it as a command option in sys.argv --capture=no is not used.

    We could say the same for --no-cov because coverage steals tracing api (sys.settrace), so if we are debugging turn of the coverage.

  4. added a commit that references this issue on Oct 10, 2022
    c6ff83a
  5. zljubisic commented on Oct 10, 2022

    @zljubisic

    How about --no-cov?

  6. eleanorjboyd commented on Oct 11, 2022

    @eleanorjboyd
    Member

    started new issue for the --no-cov feature request here: #19985

  7. zljubisic commented on Oct 11, 2022

    @zljubisic

    Thanks

  8. locked as resolved and limited conversation to collaborators on Nov 11, 2022
  9. added a commit that references this issue on Mar 28, 2024
    772f9bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-debuggingbugIssue identified by VS Code Team member as probable bugneeds PRReady to be worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions