Closed fredck closed 9 months ago
To make it easy to confirm the issue, I've created this minimal VSCode project: socket-error.zip
Just open this in VSCode:
pip install --requirement requirements.txt
pytest
from the command line in the dev container, even with the plugin installedThe conclusion is that the plugin is breaking the VSCode testing infrastructure somehow.
For those wasting their lives with this issue, I was able to fix it by adding the following configuration to the VSCode settings:
"python.experiments.enabled": false
For reference: https://github.com/microsoft/vscode-python/wiki/AB-Experiments
i continue to waste my time with this issue. I've added that setting, tried many different things and its still broke. The only thing that seems to work is commenting out the code in this modules plugin.py
# pytest_socket.socket_allow_hosts(["127.0.0.1"])
# pytest_socket.disable_socket(allow_unix_socket=True)
I am encountering an error when attempting to run pytest with the
homeassistant-custom-component
plugin. The tests fail to run, and the "A test tried to use socket.socket" error is thrown.Environment:
Steps to Reproduce:
homeassistant-custom-component
plugin.Expected Behavior: The test suite runs without any issues.
Actual Behavior: The test suite fails to start, and the following error is displayed:
Additional Information:
Any guidance or suggestions to resolve this issue would be greatly appreciated. Thank you.