44 Create a temporary Option C project root with:
49 - tests_linter/fixtures copied in
51 root = tmp_path /
"test-project"
55 (root /
"docs").mkdir()
56 (root /
"tests").mkdir()
57 (root /
"oc_diagnostics").mkdir()
58 (root /
"logs").mkdir()
59 (root /
"tests_linter").mkdir()
60 (root /
"tests_linter" /
"fixtures").mkdir(parents=
True)
63 (root /
"docs" /
"ARCHITECTURE.md").write_text(
"# Architecture\n", encoding=
"utf-8")
64 (root /
"tests" /
"run_tests.py").write_text(
"print('tests')\n", encoding=
"utf-8")
65 (root /
"tests" /
"Tests_README.md").write_text(
"Tests\n", encoding=
"utf-8")
66 (root /
"oc_diagnostics" /
"debug_config.json").write_text(
71 ' "color": "default"\n'
74 ' "global_settings": {\n'
75 ' "silent_mode": false,\n'
76 ' "enable_timestamps": true,\n'
77 ' "enable_colors": true,\n'
78 ' "include_filename": true,\n'
79 ' "output_mode": "both",\n'
80 ' "instrumentation_enabled": false,\n'
81 ' "max_log_files": 10,\n'
82 ' "max_log_size_mb": 5.0,\n'
83 ' "instrumentation_allow_all": false,\n'
85 ' "http_redact_headers": [\n'
97 project_root = Path.cwd()
98 fixtures_src = project_root /
"tests" /
"tests_linter" /
"fixtures"
99 fixtures_dst = root /
"tests_linter" /
"fixtures"
101 for f
in fixtures_src.glob(
"*.py"):
102 dst = fixtures_dst / f.name
105 rel = dst.relative_to(root).as_posix()
106 lines = dst.read_text(encoding=
"utf-8").splitlines(
True)
107 if len(lines) >= 3
and lines[2].startswith(
"# "):
108 lines[2] = f
"# {rel}\n"
109 dst.write_text(
"".join(lines), encoding=
"utf-8")