From 5a10ab9c18af9bf159c14acb241d822561f888b5 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Wed, 9 Aug 2023 14:44:07 -0400 Subject: [PATCH] Fix typing errors --- dandi/keyring.py | 1 + dandi/tests/fixtures.py | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dandi/keyring.py b/dandi/keyring.py index 99cc0767e..cc0579644 100644 --- a/dandi/keyring.py +++ b/dandi/keyring.py @@ -110,6 +110,7 @@ def keyring_op( len(kbs) == 1 ), "EncryptedKeyring not available; is pycryptodomex installed?" kb = kbs[0] + assert isinstance(kb, EncryptedKeyring) if op.exists(kb.file_path): lgr.info("EncryptedKeyring file exists; using as keyring backend") return (kb, func(kb)) diff --git a/dandi/tests/fixtures.py b/dandi/tests/fixtures.py index 2ad4505ab..a13fa954b 100644 --- a/dandi/tests/fixtures.py +++ b/dandi/tests/fixtures.py @@ -656,19 +656,17 @@ def video_files(tmp_path: Path) -> list[tuple[Path, Path]]: (nf, nx, ny) = (2, 2, 2) writer1 = cv2.VideoWriter( filename=str(movie_file1), - apiPreference=None, - fourcc=cv2.VideoWriter_fourcc(*"DIVX"), - fps=25, + apiPreference=0, + fourcc=cv2.VideoWriter.fourcc(*"DIVX"), + fps=25.0, frameSize=(ny, nx), - params=None, ) writer2 = cv2.VideoWriter( filename=str(movie_file2), - apiPreference=None, - fourcc=cv2.VideoWriter_fourcc(*"DIVX"), + apiPreference=0, + fourcc=cv2.VideoWriter.fourcc(*"DIVX"), fps=25, frameSize=(ny, nx), - params=None, ) for k in range(nf): writer1.write(np.random.randint(0, 255, (nx, ny, 3)).astype("uint8"))