Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: exec the codespell executable consistently
Currently, in test_basic.py, the run_codespell and run_codespell_stdin functions exec the codespell script from PATH, not the one from the current directory. This means that the codespell_lib package MUST first be installed, before running pytest. The current behavior is unsafe, since an user running pytest in the global environment may get an error or, worse, may actually try to test an old version. Additionally this behavior is not documented in README.md. Update the run_codespell and run_codespell_stdin functions to exec the codespell script via `python -m codespell_lib`. This change will ensure that python will try to search the __main__ module from the current directory first. Copy the codespell_lib directory to the cwd directory, and configure codespell to ignore it using the `-S` option, in order to make the environment clean. Ensure that the cwd parameter in run_codespell and run_codespell_stdin is never None, since the codespell script must not be executed from the current directory. For consistency, also make the args parameter required.
- Loading branch information