Skip to content

Commit 0d3b5c9

Browse files
Update tox.ini
Co-authored-by: LeAndre <lcjunior1220@gmail.com>
1 parent 46d6375 commit 0d3b5c9

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

tox.ini

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,27 @@ deps =
1717
sh >= 2.0.2, <3
1818
click
1919
commands =
20+
python - << 'EOF'
21+
import os, shutil, sys, glob
22+
23+
args = sys.argv[1:]
24+
if not args:
25+
# No file or directory passed → rely on pytest auto-discovery
26+
sys.exit(0)
27+
28+
for path in args:
29+
if os.path.isdir(path):
30+
# Copy all .py files inside the directory
31+
for file in glob.glob(os.path.join(path, "*.py")):
32+
new = "test_" + os.path.basename(file)
33+
shutil.copy(file, new)
34+
elif os.path.isfile(path):
35+
# Copy a single file
36+
new = "test_" + os.path.basename(path)
37+
shutil.copy(path, new)
38+
else:
39+
print(f"Warning: {path} does not exist and will be ignored.")
40+
EOF
2041
pytest --cov --cov-report=term-missing {posargs}
2142

2243
[testenv:lint]

0 commit comments

Comments
 (0)