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

Add unittest\pytest directly to debug option #22654

Closed
twiggy opened this issue Dec 14, 2023 · 2 comments
Closed

Add unittest\pytest directly to debug option #22654

twiggy opened this issue Dec 14, 2023 · 2 comments
Assignees
Labels
area-testing info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@twiggy
Copy link

twiggy commented Dec 14, 2023

In other Python IDE extensions running tests is directly integrated into the run/debug settings.

In VSCode it seams like you have to "discover" all your tests with the testing/beaker tab/sidebar.

I'm in a mono repo so I'm basically not able to use this as the configure tests as it just allows a top level folder. I have 1000s of varying types etc. So running suites of tests in my IDE is generally not very useful. Builds do it, or if I really need to I'm running complex scripts that run them in parallel etc.

In short I generally have a single test I want to run, and more precise a function in a file that is a test. Some tests are more like integration or end to end tests that don't really fit into the run 100s of tests in the IDE paradigm.

In pyDev I can just open the test file I want, and when I go to debug it ( just hit ctrl+f9) I get an option dialog.

image

a decent work around is to

if __name__ == "__main__":
    unittest.main()    

in the unit test file and then it will run the tests. there are ways to have it only do one function as well, but does require a bit of cleanup when done debugging.

Thanks!

@twiggy twiggy added the feature-request Request for new features or functionality label Dec 14, 2023
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Dec 14, 2023
@anthonykim1 anthonykim1 added area-testing and removed feature-request Request for new features or functionality labels Dec 18, 2023
@eleanorjboyd
Copy link
Member

Hi, so to clarify you are trying to run single tests but it is hard to do given you have so many tests? Is the time discovery takes the issue with the test explorer view? Are you looking for ways to specify settings per workspace for testing?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Dec 18, 2023
Copy link

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

Happy Coding!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 18, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

3 participants