Configure unittest in vscode

Asked

Viewed 286 times

1

I am unable to configure the unit test feature of Visual Studio Code. The extension keeps informing that no test has been found:

inserir a descrição da imagem aqui

My argument setting is in default mode, ie:

  #// Arguments passed in. Each argument is a separate item in the array.
  "python.unitTest.unittestArgs": [
    "-v",
    "-s",
    ".",
    "-p",
    "*test*.py"
  ],

And the structure of my project is this:

inserir a descrição da imagem aqui

That is, the extension is not locating the module guardtest inside the briefcase tests.

Follows the link description of the resource.

1 answer

0


Solved!

As my tests are not from the project root directory, I had to inform the directory in the configuration file, so it was like this:

    "python.unitTest.unittestArgs": [
    "-v",
    "-s",
    "tests",
    "-p",
    "*test*.py"
]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.