Ask Your Question
1

Test discovery without test running?

asked 2021-09-01 15:37:50 -0600

Tmr gravatar image

updated 2021-09-02 07:40:56 -0600

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-09-02 07:40:50 -0600

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.

edit flag offensive delete link more

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 gravatar image Tmr  ( 2021-09-02 15:26:45 -0600 )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 gravatar image Wingware Support  ( 2021-09-02 16:24:01 -0600 )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 gravatar image Tmr  ( 2021-09-02 17:33:48 -0600 )edit

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

Wingware Support gravatar image Wingware Support  ( 2021-09-03 12:07:09 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-09-01 15:37:50 -0600

Seen: 48 times

Last updated: Sep 03