File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ import os
2+ import shutil
3+ import sys
4+
5+ args = sys .argv [1 :]
6+ copied = []
7+
8+ def copy_file (src ):
9+ base = os .path .basename (src )
10+ new = f"test_{ base } "
11+ shutil .copy (src , new )
12+ copied .append (new )
13+ print (f"[tox] Copied: { src } → { new } " )
14+
15+ def walk_dir (path ):
16+ for root , _ , files in os .walk (path ):
17+ for f in files :
18+ if f .endswith (".py" ):
19+ copy_file (os .path .join (root , f ))
20+
21+ if not args :
22+ print ("[tox] No files or directories passed — using pytest auto-discovery." )
23+ else :
24+ for path in args :
25+ if os .path .isdir (path ):
26+ print (f"[tox] Recursively scanning directory: { path } " )
27+ walk_dir (path )
28+ elif os .path .isfile (path ):
29+ copy_file (path )
30+ else :
31+ print (f"[tox] Warning: { path } does not exist and will be ignored." )
32+
33+ with open (".tox_copied_files" , "w" ) as f :
34+ for name in copied :
35+ f .write (name + "\n " )
You can’t perform that action at this time.
0 commit comments