MCPcopy Create free account
hub / github.com/skyzh/tiny-llm / copy_test

Function copy_test

scripts/dev-tools.py:8–22  ·  view source on GitHub ↗
(args, skip_if_exists=False, force=False)

Source from the content-addressed store, hash-verified

6
7
8def copy_test(args, skip_if_exists=False, force=False):
9 source_file = f"tests_refsol/test_week_{args.week}_day_{args.day}.py"
10 target_file = f"tests/test_week_{args.week}_day_{args.day}.py"
11 if skip_if_exists and os.path.exists(target_file) and not force:
12 # diff the two files and warn if they are different
13 if Path(source_file).read_text() != Path(target_file).read_text():
14 print(
15 f"[WARNING] {target_file} already exists and is different from {source_file}"
16 )
17 print(
18 f"You can run `pdm run copy-test --week {args.week} --day {args.day} --force` to update it"
19 )
20 return
21 print(f"copying {source_file} to {target_file}")
22 shutil.copyfile(source_file, target_file)
23
24
25def test(args):

Callers 2

testFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected