You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running Python tests in VS Code using Test Adapter Converter UI, test will hang if I individually run a test that uses mock_open from unittest.
If I run the individual test from command line, it works as expected. If I run all the tests in the file, both from the UI or terminal, it also works as expected without hanging. If I run the individual test from the UI in debug mode, it also works as intended.
Note: When running the test individually from the UI, even if it hangs, the test results tab shows the expected message indicating that the test passed correctly:
However, the Finished running tests! line won't show up until I manually stop the test from the UI.
Enviroment
I am using Python 3.12.1, in a Poetry enviroment, with pytest 8.3.3 (latest release as of right now) and pytest-cov 5.0.0. VS Code is in version 1.95.1, and my installed extensions are:
Python: v2024.18.0
Pylance: v2024.11.1
Python Debugger: v2024.12.0
Test Adapter Converter: v0.2.1
YAML: v1.15.0
SonarLint: v.4.11.1
PowerShell: v2024.4.0
GitHub Actions: v0.27.0
Even Better TOML: v0.19.2
All of this is running in a Windows 10 laptop.
Example
To replicate this issue, i made this simple function:
Description
When running Python tests in VS Code using Test Adapter Converter UI, test will hang if I individually run a test that uses mock_open from unittest.
If I run the individual test from command line, it works as expected. If I run all the tests in the file, both from the UI or terminal, it also works as expected without hanging. If I run the individual test from the UI in debug mode, it also works as intended.
Note: When running the test individually from the UI, even if it hangs, the test results tab shows the expected message indicating that the test passed correctly:
However, the
Finished running tests!
line won't show up until I manually stop the test from the UI.Enviroment
I am using Python 3.12.1, in a Poetry enviroment, with pytest 8.3.3 (latest release as of right now) and pytest-cov 5.0.0. VS Code is in version 1.95.1, and my installed extensions are:
All of this is running in a Windows 10 laptop.
Example
To replicate this issue, i made this simple function:
With this test:
The text was updated successfully, but these errors were encountered: