"""Shared test helpers.""" import os import unittest def skip_unless_env(var_name): """Mirrors graphloop's RUN_REAL_AGENT_E2E=1 pattern (CLAUDE.md Testing constraint): tests that shell out to the real `claude` CLI are gated behind an explicit env var and skipped by default.""" return unittest.skipUnless( os.environ.get(var_name) == "1", "set {}=1 to run (shells out to the real `claude` CLI, costs real API usage)".format(var_name), )