3

I'm trying to run tests in Visual Studio Code written for Nose 2. Neither the unittest nor nosetests options in the Python extension seem to be able to discover the tests correctly.

The test cases live in a number of python files in a subdirectory a couple levels down from root, for example:

(root)/test_suite/test_cases/[test script files]

How do I get Visual Studio Code to discover these tests? I've used PyCharm with this project in the past and it has no problem with test discovery.

Topperfalkon
  • 145
  • 1
  • 6
  • I'm also trying to answer your question, but if there isn't a canonical way, we could use [custom tasks](https://code.visualstudio.com/docs/editor/tasks#_custom-tasks) – shaunc Sep 19 '20 at 03:32

1 Answers1

-1

You can specify arguments to nose (or unittest) via a setting, e.g. "python.unitTest.nosetestArgs", so you should be able to construct the appropriate arguments to discover the tests in that directory.

Brett Cannon
  • 14,438
  • 3
  • 45
  • 40