@@ -64,19 +64,14 @@ def test_channels_typing() -> None:
6464 ):
6565 positional_as_keyword .to_dict ()
6666
67- keyword_as_positional = angle .sort ("field:Q" , "min" , "descending" ) # type: ignore[call-overload]
68- with pytest .raises (SchemaValidationError ):
69- keyword_as_positional .to_dict ()
67+ with pytest .raises (
68+ TypeError , match = r"sort\(\) accepts at most one positional argument"
69+ ):
70+ angle .sort ("field:Q" , "min" , "descending" ) # type: ignore[call-overload]
7071 angle .sort (field = "field:Q" , op = "min" , order = "descending" )
7172
72- # NOTE: Doesn't raise `SchemaValidationError`
73- # - `"ascending"` is silently ignored when positional
74- # - Caught as invalid statically, but not at runtime
75- bad = angle .sort ("x" , "ascending" ).to_dict () # type: ignore[call-overload]
76- good = angle .sort (encoding = "x" , order = "ascending" ).to_dict ()
77- assert isinstance (bad , dict )
78- assert isinstance (good , dict )
7973 with pytest .raises (
80- AssertionError , match = r"'x' == {'encoding': 'x', 'order': 'ascending'} "
74+ TypeError , match = r"sort\(\) accepts at most one positional argument "
8175 ):
82- assert bad ["sort" ] == good ["sort" ]
76+ angle .sort ("x" , "ascending" ) # type: ignore[call-overload]
77+ assert angle .sort (encoding = "x" , order = "ascending" ).to_dict ()
0 commit comments