Merge pull request #155 from jepler/small-tweaks

testwwvb: better(?) alternative
This commit is contained in:
Jeff Epler 2025-08-27 09:33:07 -05:00 committed by GitHub
commit 779337f8af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,6 @@ import io
import pathlib
import random
import sys
import typing
import unittest
import uwwvb
@ -48,13 +47,12 @@ class WWVBTestCase(unittest.TestCase):
channel: WWVBChannel = "amplitude"
style = "default"
for o in options:
if o.startswith("--channel="):
value = o[10:]
if value in {"both", "amplitude", "phase"}:
# pyrefly: ignore # redundant-cast
channel = typing.cast("WWVBChannel", value)
else:
raise ValueError(f"Unknown channel {o!r}")
if o == "--channel=both":
channel = "both"
elif o == "--channel=amplitude":
channel = "amplitude"
elif o == "--channel=phase":
channel = "phase"
elif o.startswith("--style="):
style = o[8:]
else: