Skip to content

test_package issue: subprocess.run needs shell=True #84

Closed
@dmdunla

Description

@dmdunla

On some systems (e.g. Mac), calls to subprocess.run() must include shell=True:

==================================================================================================== short test summary info ====================================================================================================
FAILED tests/test_package.py::test_formatting - FileNotFoundError: [Errno 2] No such file or directory: 'isort <PATH>/pyttb --check --settings-path <PATH>/pyttb'
FAILED tests/test_package.py::test_linting - FileNotFoundError: [Errno 2] No such file or directory: 'pylint <PATH>/pyttb/pyttb/tensor.py <PATH>/pyttb/pyttb/sptensor.py <PATH>/pyttb/pyttb/pyttb_ut...
FAILED tests/test_package.py::test_typing - FileNotFoundError: [Errno 2] No such file or directory: 'mypy -p pyttb  --config-file <PATH>/pyttb/pyproject.toml'
=========================================================================================== 3 failed, 336 passed, 7 warnings in 1.69s ===========================================================================================

Example fix:

subprocess.run(f"isort {root_dir} --check --settings-path {root_dir}", check=True, shell=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions