testwwvb: better(?) alternative
avoids typing.cast & pyrefly: ignore
This commit is contained in:
parent
bf0b767a74
commit
906cd45d32
1 changed files with 6 additions and 8 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue