'Ignore submodules for pytest in vsc

I am using VSC with pytest to debug my code. This worked fine until I added a submodule which I used in the past. The Codebase in the submodule has not the same standard as my main module and causes the vsc discovery to fail.

I already added:

"python.testing.pytestArgs": [
        "--ignore=${workspaceFolder}/main_package/submodule/",
]

to my vsc settings, but it seems vsc doesn't care about the ignore.

This is slowing my progress extremely down because I don't really understand why the discovery fails. I might be something with the imports but the code and also pylance have no issue with the import.

Output/Python results in

E   ModuleNotFoundError: No module named 'core'

which is in the root structure of the submodule and the submodule is a subpackage of the main package.

Is it better to move the submodule out of the main package and use it as a seperate package?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source