Free Python Unit Test Generation Tool in VSCode
visual studio code - Debugging Python unittest in vscode behaves differently than normal test execution - Stack Overflow
Test Python code interactively in VS Code - Stack Overflow
testing - How to run Run only a Single test in Visual Studio Code and Python with output - Stack Overflow
Videos
I created a free Visual Studio Code extension that allows users to automatically create tests for their python code. Please find it here: https://marketplace.visualstudio.com/items?itemName=Tenerate.Tenerate
To use Tenerate, simply install the extension in Visual Studio Code and then open your python code file. From there, you can use Tenerate by clicking Command + T (Mac) or Control + Alt + T (Windows) on a function name and the extension will automatically generate tests. The extension uses the OpenAI Codex models but does not require signing in OpenAI and does not use ChatGPT.
PS: I created this post with the help of ChatGPT
I did not find one elegant way to just run one test and then see the correct sampled/collected output from that test, but I found a way to run only the test I was working on by tagging it with:
@pytest.mark.run_this_test
and hit F5 anywhere in VSCode to just run this test over and over again. The PyTest debug config looks like this:
{
"name": "PyTest",
"type": "python",
"request": "launch",
"console": "integratedTerminal",
"module": "pytest",
"args": [
"-s", "-m run_this_test"
],
"justMyCode": false,
"pythonPath": "${config:python.pythonPath}",
"env": {
"PYTHONPATH": "${workspaceRoot}"
}
This 'tagging' does not scale in a team obviously, but it works for me alone.
I created a repo containing my solution: https://bitbucket.org/geircode/vscode-testsetup-python
To test it:
- run the script "requirements.install.bat"
- open vscode in the root folder
- select "PyTest" in the "debug and run" tab
- Hit F5 to start debugging and see the correct output from the test
From VS Code test explorer it's possible. Hope this helps.

Been working on a python tool for VS Code. Curious to get peoples' opinion on how they run python files (not notebooks) within VS Code. Do you typically run files python by:
-
Typing the python command into the integrated terminal
-
Clicking the run button at the top of the file
-
Pressing F5 for debugging
-
Pressing Ctrl+F5 for run but not debug
-
Creating a custom keyboard shortcut
-
Other
Let me know your thoughts, I appreciate the insights!