File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""Minimal exception templating used by taskiq exceptions."""
22
3+ import sys
34from string import Formatter
45
6+ if sys .version_info >= (3 , 11 ):
7+ from typing import dataclass_transform
8+ else :
9+ from typing_extensions import dataclass_transform
510
11+
12+ @dataclass_transform (
13+ eq_default = False ,
14+ order_default = False ,
15+ kw_only_default = True ,
16+ frozen_default = False ,
17+ )
618class Error (Exception ):
719 """Base templated exception compatible with taskiq needs."""
820
Original file line number Diff line number Diff line change @@ -51,12 +51,12 @@ def test_template_with_required_value() -> None:
5151
5252def test_missing_argument_raises_type_error () -> None :
5353 with pytest .raises (TypeError , match = "Missing arguments: 'value'" ):
54- ValueTemplateError ()
54+ ValueTemplateError () # type: ignore[call-arg]
5555
5656
5757def test_undeclared_argument_raises_type_error () -> None :
5858 with pytest .raises (TypeError , match = "Undeclared arguments: 'extra'" ):
59- ValueTemplateError (value = 1 , extra = 2 )
59+ ValueTemplateError (value = 1 , extra = 2 ) # type: ignore[call-arg]
6060
6161
6262def test_default_value_is_used_without_kwargs () -> None :
You can’t perform that action at this time.
0 commit comments