@@ -227,21 +227,21 @@ jobs:
227227 # Check if specific test exists
228228 if [ -n "$pattern_dir" ]; then
229229 test_path="tests/${pattern_dir}/test_${module_name}.py"
230- echo " if [ -f \"${test_path}\" ]; then echo \"Test file ${test_path} exists: true\" && pytest -xvs --cov=main --cov-append ${test_path}; else echo \"Test file ${test_path} exists: false\"; fi" >> tox_pr.ini
230+ echo " if [ -f \"${test_path}\" ]; then echo \"Test file ${test_path} exists: true\" && coverage run -m pytest -xvs --cov=main --cov-append ${test_path}; else echo \"Test file ${test_path} exists: false\"; fi" >> tox_pr.ini
231231
232232 # Also try to find any test that might include this module
233- echo " pytest -xvs --cov=main --cov-append tests/${pattern_dir}/ -k \"${module_name}\" --no-header" >> tox_pr.ini
233+ echo " coverage run -m pytest -xvs --cov=main --cov-append tests/${pattern_dir}/ -k \"${module_name}\" --no-header" >> tox_pr.ini
234234 fi
235235
236236 # Run doctests for the file
237- echo " pytest --doctest-modules -v --cov=main --cov-append $file" >> tox_pr.ini
237+ echo " coverage run -m pytest --doctest-modules -v --cov=main --cov-append $file" >> tox_pr.ini
238238
239239 has_tests=true
240240 fi
241241
242242 # Run test files directly if modified
243243 if [[ $file == tests/* ]]; then
244- echo " pytest -xvs --cov=main --cov-append $file" >> tox_pr.ini
244+ echo " coverage run -m pytest -xvs --cov=main --cov-append $file" >> tox_pr.ini
245245 has_tests=true
246246 fi
247247 fi
@@ -251,12 +251,12 @@ jobs:
251251 if [ "$has_tests" = false ]; then
252252 echo " python -c \"print('No specific tests found for changed files. Consider adding tests.')\"" >> tox_pr.ini
253253 # Add a minimal test to avoid failure, but ensure it generates coverage data
254- echo " pytest -xvs --cov=main --cov-append -k \"not integration\" --no-header" >> tox_pr.ini
254+ echo " coverage run -m pytest -xvs --cov=main --cov-append -k \"not integration\" --no-header" >> tox_pr.ini
255255 fi
256256
257257 # Add coverage report command
258258 echo " coverage combine" >> tox_pr.ini
259- echo " coverage report" >> tox_pr.ini
259+ echo " coverage report -m " >> tox_pr.ini
260260
261261 # Run tox with the custom configuration
262262 echo "Running tox with custom PR configuration..."
0 commit comments