pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
696 stars 164 forks source link

Fix spawn tests in different environments #1667

Closed lucc closed 1 month ago

lucc commented 1 month ago

We are running our tests in different environments, sometimes with a terminal as stdin and sometimes with /dev/null as stdin. Both are seen as "not a pipe" by test -p so we use that to test if our python code redirects text into an external process.

This fixes #1580.

This pull request is based on my comment https://github.com/pazz/alot/issues/1580#issuecomment-2258138340

lucc commented 1 month ago

@dcbaker are you available to review this?

lucc commented 1 month ago

It seems that /dev/stdin is not portable (https://unix.stackexchange.com/questions/36403/how-portable-are-dev-stdin-dev-stdout-and-dev-stderr). @pazz is that ok for us?

pazz commented 1 month ago

It seems that /dev/stdin is not portable (https://unix.stackexchange.com/questions/36403/how-portable-are-dev-stdin-dev-stdout-and-dev-stderr). @pazz is that ok for us?

I think we can assume that the intersection of alot and SunOS or similar is empty. Let's not make an issue of it and just use /dev/stderr and friends and reconsider should anyone ever run into issue with it?

lucc commented 1 month ago

@pazz agreed, can you do a review if @dcbaker is not available then we can merge it.