Name the PipeWire the check is for, and keep it out of the tests

--raw arrived in 1.4, the same release that stopped reading a bare "-" as
raw on its own. The split is there rather than at 1.0: Ubuntu 24.10 and
anything else on 1.2 refuses the option too, and 1.4 onwards writes a
container around the stream without it.

Asking the installed binary meant the command tests ran pw-record --help
four times for real, on a machine whose answer decides what they see, which
the module docstring promises they never do. They pin the answer in setUp,
and the reading itself gets its own class, the empty help nobody covered
included.
This commit is contained in:
yusufipk
2026-08-05 18:41:23 +03:00
parent 49b940bcb9
commit f6754ebf43
2 changed files with 50 additions and 22 deletions
+6 -3
View File
@@ -458,9 +458,12 @@ def _pulse_record(target):
def _pw_record_raw_option():
"""Use --raw only on pw-record releases that provide it.
PipeWire 1.0, including Ubuntu 24.04's build, writes raw PCM to stdout but
rejects the newer --raw option. A rejected option ends the recorder before
it receives sound, so ask the installed binary which form it understands.
PipeWire gained --raw in 1.4, and in the same release stopped treating a
filename of "-" as raw on its own: before it, the option is refused and the
recorder dies before any sound arrives; after it, leaving the option out
wraps the stream in a container the rest of this file would read as noise.
Ubuntu 24.04 and anything else still on 1.0 or 1.2 sit on the near side of
that line, so ask the installed binary which form it understands.
"""
try:
result = subprocess.run(