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

Printing something in Debug Console should print it when no terminal is created to see the output (since running a test in debug mode from right clicking in the margin). #947

Closed
guillaume-chevalier opened this issue Jun 2, 2022 · 5 comments

Comments

@guillaume-chevalier
Copy link

Environment data

  • debugpy version: 1.6.0
  • OS and version: Mac OS Monterey 12.3.1
  • Python version (& distribution if applicable, e.g. Anaconda): 3.9
  • Using VS Code or Visual Studio: VS Code

Actual behavior

Printing something in Debug Console should print it when no terminal is created to see the output.

Expected behavior

Debug console doesn't print anything. The process cannot be found in the other terminal tab because it is started from a right click on a test and then clicking debug in the code's margin.

Steps to reproduce:

  1. Right-click on a test and then click debug in the code's margin.
  2. Observe that there is no terminal process that were started in the Terminal vs code tab, since the process was started using the testing instead of as a regular run configuration.
  3. print("something \n that \n spans \n a \n few \n lines.") in the debug console doesn't output anything. To see proper newlines I need to split it on newlines "something \n that \n spans \n a \n few \n lines.".split(\n) and these prints are annoying. Visual acuity is reduced a lot here.

Related: https://stackoverflow.com/questions/71811731/how-do-you-get-vs-code-to-write-debug-stdout-to-the-debug-console

@int19h
Copy link
Contributor

int19h commented Jun 3, 2022

Is this specific to debugging tests, or do you also see it when doing regular F5 debugging?

@IlseLankhorst
Copy link

I have the same problem. This is only for debugging tests. As stated on the stackoverflow page.

@int19h
Copy link
Contributor

int19h commented Jun 17, 2022

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

@fabioz
Copy link
Collaborator

fabioz commented Jul 7, 2022

Closing since it doesn't seem like we need to do anything in debugpy here (the proper issue to manage how pytest is launched so that the output is not captured is already created in vscode-python).

@fabioz fabioz closed this as completed Jul 7, 2022
@pabloazurduy
Copy link

pabloazurduy commented Jul 7, 2022

hi @fabioz is there a way to pass the --capture=no arg to the test-tab launcher ? I thought that It was not possible yet is there an issue where we can support that feature? thanks in advance! :)

nevermind. ICYI this is the new issue

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

No branches or pull requests

6 participants