mirror of
https://github.com/hwchase17/langchain
synced 2024-11-20 03:25:56 +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")
|