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

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

Closed
karthiknadig opened this issue Jun 17, 2022 · 6 comments · Fixed by #19903
Closed

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

karthiknadig opened this issue Jun 17, 2022 · 6 comments · Fixed by #19903
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on

Comments

@karthiknadig
Copy link
Member

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 @int19h in microsoft/debugpy#947 (comment)

@harupy
Copy link

harupy commented Sep 24, 2022

@karthiknadig Can I work on this issue?

@karthiknadig
Copy link
Member Author

@harupy go ahead.

@zljubisic
Copy link

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.

@zljubisic
Copy link

How about --no-cov?

@eleanorjboyd
Copy link
Member

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

@zljubisic
Copy link

Thanks

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug needs PR Ready to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants