Closed andez2000 closed 1 year ago
Thanks for reporting this issue, the extension runs the behave
command on the root level of the workspace. In this case, the features
folder is found in the app
folder and not on the root level which means the behave command can't find any feature files.
I will think of a solution, and most likely add a config to state in which folder the behave
command should be run.
OK thank you for the quick response.
In the mean time, I have:
app
folder in VSCode .vscode
folder and changed interpreter to the new pathSo the folder tree is now:
│ main.py
│ requirements.txt
│
├───.venv
│ ...
├───.vscode
│ settings.json
│
└───features
│ my_feature.feature
│
└───steps
my_feature_steps.py
{
"python.defaultInterpreterPath":"${workspaceFolder}/.venv/Scripts/python.exe",
"python.terminal.activateEnvironment": true,
}
I can still run behave
from the console manually. My test explorer shows as follows:
Currently the extension doesn't use the Python interpreter specified in settings.json
, it uses the global installation. This is the same issue as #2.
I will try to fix and figure out how to use the interpreter path instead as this is a pretty big issue.
Cool thanks.
Once behave is installed in the global pip packages:
I can now see the tests.
Would be great to get fix to use the settings path.
Amazing, thanks
I have VSCode installed on Windows 10:
I have a folder opened in VSCode containing my project with a
venv
setup to run my code against. At the moment I have created a feature file and step file with a simple Given When Then.When I activate the venv and run the tests by running
behave
, I get the output in the terminal.My project looks like this:
venv packages
.vscode/settings.json
app/features/my_feature.feature
app\features\steps\my_feature_steps.py
Test Explorer Window
Extensions
Test Explorer UI v2.21.1
Python Test Explorer for Visual Studio Code v0.7.1
Behave Test Explorer v1.0.0
Where to go now?
I cannot see tests. I am not sure what I need to put in place to run this extension so I can see the tests.
In the Test Explorer - there are two options:
Configure Python Tests
andInstall Additional Test Extensions...
. If I click onConfigure Python Tests
then onlyunittest
andpytest
are displayed.