mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.81k stars 351 forks source link

test: Add fixture for testing the `y/n` prompt #3452

Open jjerphan opened 3 weeks ago

jjerphan commented 3 weeks ago

Currently only the y case and dry-run can be tested with --yes and --dry-run respectively.

There's no way to test the n case as briefly discussed in #3450.

We must be able to test all interactive cases of the CLI.

jjerphan commented 3 weeks ago

This can be implemented by introducing always_no similarly to the already existing always_yes which could be triggered via a --no flag, in which case one would need to prevent its interactions with --no.

jjerphan commented 3 weeks ago

An alternative is to prepend echo n | to the command executed by the sub-process via the python helpers.