mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-13 05:25:07 +00:00
Block sockets for unit-tests (#4803)
# Block usage of sockets during unit tests Catch any tests that attempt to use the network.
This commit is contained in:
9
tests/unit_tests/test_pytest_config.py
Normal file
9
tests/unit_tests/test_pytest_config.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import pytest
|
||||
import pytest_socket
|
||||
import requests
|
||||
|
||||
|
||||
def test_socket_disabled() -> None:
|
||||
"""This test should fail."""
|
||||
with pytest.raises(pytest_socket.SocketBlockedError):
|
||||
requests.get("https://www.example.com")
|
Reference in New Issue
Block a user