Skip to content

Commit

Permalink
chore: Need from __future__ import annotations for X | Y
Browse files Browse the repository at this point in the history
  • Loading branch information
mdomke committed Sep 20, 2023
1 parent 22a4fe9 commit 91dcde1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_ulid.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import time
import uuid
from collections.abc import Callable
Expand Down Expand Up @@ -128,6 +130,9 @@ def test_ulid_from_timestamp() -> None:
assert ulid1.timestamp == ulid2.timestamp


Params = bytes | str | int | float


@pytest.mark.parametrize(
("constructor", "value"),
[
Expand All @@ -142,6 +147,6 @@ def test_ulid_from_timestamp() -> None:
(ULID.from_uuid, "not-a-uuid"),
],
)
def test_ulid_invalid_input(constructor: Callable, value: bytes | str | int | float) -> None:
def test_ulid_invalid_input(constructor: Callable[[Params], ULID], value: Params) -> None:
with pytest.raises(ValueError): # noqa: PT011
constructor(value)

0 comments on commit 91dcde1

Please sign in to comment.