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