MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / _test_env

Function _test_env

tests/unit/core/test_cgcignore_patterns.py:24–34  ·  view source on GitHub ↗

Run shell-based CGC tests against the current interpreter in an isolated HOME.

()

Source from the content-addressed store, hash-verified

22
23
24def _test_env():
25 """Run shell-based CGC tests against the current interpreter in an isolated HOME."""
26 TEST_HOME.mkdir(parents=True, exist_ok=True)
27 env = os.environ.copy()
28 env["HOME"] = str(TEST_HOME)
29 env["DEFAULT_DATABASE"] = "falkordb"
30 env["CGC_CONTEXT_MODE"] = "global"
31 env["PYTHONDONTWRITEBYTECODE"] = "1"
32 # Ensure all current sys.path entries are in PYTHONPATH so dependencies and -m work
33 env["PYTHONPATH"] = os.pathsep.join(sys.path)
34 return env
35
36def get_unique_test_dir():
37 """Generate unique test directory"""

Callers 1

runFunction · 0.85

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected