"""TS-03 — reset process-global state between tests.

mgf.http._client carries a once-per-process `_TLS_DISABLE_WARNED` flag (the
verify_tls=False UserWarning is emitted once). Without a reset, one test that
disables TLS leaks the flag into later tests. This autouse fixture snapshots +
restores it around every test.
"""

from __future__ import annotations

import pytest

import mgf.http._client as _client


@pytest.fixture(autouse=True)
def _reset_tls_warned():
    saved = _client._TLS_DISABLE_WARNED
    _client._TLS_DISABLE_WARNED = False
    try:
        yield
    finally:
        _client._TLS_DISABLE_WARNED = saved
