mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
c3b6129beb
# Block usage of sockets during unit tests Catch any tests that attempt to use the network.
10 lines
228 B
Python
10 lines
228 B
Python
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")
|