Writing tests in Python using pytest framework
For import classes and functions from subdirectory I write this dicertory at the beginning of the path
My problem is that if i don’t write dot at the beginning of the path then code runs fine through VS Code but getting an error if code runs through terminal
If i write dot at the beginning of the path then code runs fine through terminal but getting error if code runs through VS Code
It’s very uncomfortable and i want to specidfy single import order for editor and language
I hope somebody know how make this
2
Answers
Dot in import means that this directory is package. And my directory is package, because it have file "init.py" You can find more information about package in python on internet
You should read CWD. There are no errors in vscode and in the terminal when I don’t use dots here.
Vscode uses the open folder as the workspace, and you are likely to have errors in the workspace.