First time here? Check out the FAQ!
1

Test discovery without test running?

Is there any way to populate the list of individual tests in Wing's 'Testing' window without executing all the tests in a module? I would like to be able to select an individual test to run without first having to execute all the tests. Something similar to pytest --collect-only.

Tmr's avatar
25
Tmr
asked 2021-09-01 15:37:50 -0500
Wingware Support's avatar
4k
Wingware Support
updated 2021-09-02 07:40:56 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

If you open the test code in the editor and place the caret in the test, using Run Tests at Cursor in the Testing menu should run that test. There are times where this won't help, for example if tests are generated at runtime, but it covers most real world cases.

Wingware Support's avatar
4k
Wingware Support
answered 2021-09-02 07:40:50 -0500
edit flag offensive 0 remove flag delete link

Comments

Are you referring to 'Run Tests' in the right click menu? I wasn't aware of that feature. When I try to use it however I get

ERROR: Not found: path/to/test/module.py::test_name|0|

Note the |0| after the test name.

Tmr's avatar Tmr (2021-09-02 15:26:45 -0500) edit

No, I meant the item in the Testing menu in the menu bar. The context menu item should also work, but appears to be broken in Wing 8 due to changes in the underlying code analysis system. We'll try to fix that soon... thanks for pointing out the problem!

Wingware Support's avatar Wingware Support (2021-09-02 16:24:01 -0500) edit
1

Ah, I see it now. The testing menu item works as you describe. Thanks!

If possible, It would also be nice if we could populate tests in the 'Testing' pane without running them. I'm a big fan of that view.

Tmr's avatar Tmr (2021-09-02 17:33:48 -0500) edit

I think this may only be possible with some testing frameworks, but I agree it would be nice to have.

Wingware Support's avatar Wingware Support (2021-09-03 12:07:09 -0500) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer