painless-software / python-cli-test-helpers

Useful helpers for writing tests for your Python CLI program.
https://python-cli-test-helpers.readthedocs.io
GNU General Public License v3.0
30 stars 4 forks source link

Use ` assert shutil.which("example")` for testing entrypoint script existence #52

Open bittner opened 8 months ago

bittner commented 8 months ago

Currently, the example demonstrate using the package's shell command to verify the existence of an entrypoint script.

Another way to perform the verification would be shutil.which, which is a platform-independent implementation of where (Windows) and which (Unix/Linux/macOS). Example:

def test_entrypoint():
    assert shutil.which("example")