Skip to content

Open correct position in Pytest Test Log with a single click on any test #17371

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

Open
brettcannon opened this issue Sep 10, 2021 Discussed in #17364 · 2 comments
Open

Open correct position in Pytest Test Log with a single click on any test #17371

brettcannon opened this issue Sep 10, 2021 Discussed in #17364 · 2 comments
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug needs proposal Need to make some design decisions

Comments

@brettcannon
Copy link
Member

Discussed in #17364

Originally posted by andrmueller September 9, 2021
Hey there!

I really like how you move on with this extension. Especially testing got way better!

The Problem

There is one single thing that slows my developer process down quite a bit:
When clicking on a test that is currently executed or has been executed sometime before in the current VS code window the output of this specific test does not open up automatically. The output to show would be the Python Test Log.
i.e. with pytest:

=================================== FAILURES ===================================
___________________ test_z ____________________

line 1
line 2

line3
...

What I tried

Using the shortcut: "testing.showMostRecentOutput" -> "when": "testing.hasAnyResults".
Sadly this does not open up the Python Test Log output, but a terminal with the test run output which IMHO is not readable enough regarding formatting to be used to debug errors in tests.

The most recent output looks something like this when using pytest:

Current working directory: /...
Workspace directory: /...
Run completed, parsing output
./tests/.../test_xy.py::test_z Failed: <error>
line 1
                                                                line 2

                                                                                               line 3

The Python Test Log output looks way cleaner and it's the actual pytest/unittest output which people are used to.

Current circumvention

  • Execute 1 or multiple tests by using the Testing panel
  • Open up the output with a shortcut ("python.viewOutput")
  • Use the mouse to open Python Test Log channel
  • Scroll to the test I'm interested in logs or errors manually or by using the search in the output window using the test name

Feature Request

  • Execute 1 or multiple tests by using the Testing panel
  • Click on any of the tests with a single click
  • Pytest Test Log output is opened
  • The window scrolls to the start or end of the test output for the clicked test
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Sep 10, 2021
@karthiknadig
Copy link
Member

Bad formatting is due to this issue: #17111

@karthiknadig karthiknadig self-assigned this Sep 13, 2021
@karthiknadig karthiknadig added area-testing bug Issue identified by VS Code Team member as probable bug triage and removed triage-needed Needs assignment to the proper sub-team labels Sep 13, 2021
@skilkis
Copy link

skilkis commented Mar 3, 2022

Hey @karthiknadig I second the feature request of @brettcannon . It would be great if the "Show Output" option in the Testing Extension could be configured to target either the Test Output or the Test Log. Reason being is that I usually want to see the raw logs when debugging a test. I imagine others might want to see the Test Output instead.

@karthiknadig karthiknadig added triage-needed Needs assignment to the proper sub-team and removed triage labels May 4, 2022
@karthiknadig karthiknadig removed their assignment Jun 7, 2022
@karthiknadig karthiknadig added needs proposal Need to make some design decisions and removed triage-needed Needs assignment to the proper sub-team labels Jun 7, 2022
@eleanorjboyd eleanorjboyd self-assigned this Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing bug Issue identified by VS Code Team member as probable bug needs proposal Need to make some design decisions
Projects
None yet
Development

No branches or pull requests

4 participants