Skip to content

Commit cb7c8d4

Browse files
Update tox.ini
Co-authored-by: LeAndre <lcjunior1220@gmail.com>
1 parent 92a074d commit cb7c8d4

File tree

1 file changed

+2
-53
lines changed

1 file changed

+2
-53
lines changed

tox.ini

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -17,60 +17,9 @@ deps =
1717
sh >= 2.0.2, <3
1818
click
1919
commands =
20-
python - <<EOF
21-
import os, shutil, sys
22-
23-
args = sys.argv[1:]
24-
copied = []
25-
26-
def copy_file(src):
27-
"""Copy a file into a pytest-discoverable name."""
28-
base = os.path.basename(src)
29-
new = f"test_{base}"
30-
shutil.copy(src, new)
31-
copied.append(new)
32-
print(f"[tox] Copied: {src} → {new}")
33-
34-
def walk_dir(path):
35-
"""Recursively copy all .py files inside a directory."""
36-
for root, _, files in os.walk(path):
37-
for f in files:
38-
if f.endswith(".py"):
39-
copy_file(os.path.join(root, f))
40-
41-
if not args:
42-
print("[tox] No files or directories passed — using pytest auto-discovery.")
43-
else:
44-
for path in args:
45-
if os.path.isdir(path):
46-
print(f"[tox] Recursively scanning directory: {path}")
47-
walk_dir(path)
48-
elif os.path.isfile(path):
49-
copy_file(path)
50-
else:
51-
print(f"[tox] Warning: {path} does not exist and will be ignored.")
52-
53-
# Store copied filenames for cleanup
54-
with open(".tox_copied_files", "w") as f:
55-
for name in copied:
56-
f.write(name + "\n")
57-
EOF
58-
20+
python scripts/prepare_tests.py {posargs}
5921
pytest --cov --cov-report=term-missing {posargs}
60-
61-
python - <<EOF
62-
import os
63-
64-
# Cleanup temporary test_*.py files
65-
if os.path.exists(".tox_copied_files"):
66-
with open(".tox_copied_files") as f:
67-
for line in f:
68-
name = line.strip()
69-
if os.path.exists(name):
70-
os.remove(name)
71-
print(f"[tox] Cleaned up: {name}")
72-
os.remove(".tox_copied_files")
73-
EOF
22+
python scripts/cleanup_tests.py
7423

7524
[testenv:lint]
7625
skip_install = true

0 commit comments

Comments
 (0)