HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //snap/certbot/current/lib/python3.12/site-packages/certbot/_internal/tests/conftest.py
from unittest import mock

import pytest

# This avoids a bug on mac where getfqdn errors after a long timeout.
# See https://bugs.python.org/issue35164
# and discussion at https://github.com/certbot/certbot/pull/10408
@pytest.fixture(autouse=True)
def mock_getfqdn():
    with mock.patch("socket.getfqdn", return_value="server_name") as mocked:
        yield mocked

@pytest.fixture(autouse=True)
def mock_sleep():
    with mock.patch("time.sleep") as mocked:
        yield mocked