python-docx-template
python-docx-template copied to clipboard
Fix test runner to use current Python and report failures
Summary
- Run test scripts with
sys.executableso the active virtualenv/CI Python is preserved. - Resolve test files relative to the
tests/directory, allowingpython tests/runtests.pyfrom the repo root. - Exit non-zero when any test script fails.
- Replace
os.system("python -m docxtpl ...")withsubprocess.run(..., check=True).
Verification
python tests/runtests.pypython -m flake8 docxtpl tests setup.py --count --max-line-length=127 --show-source --statistics