@@ -85,35 +85,28 @@ def test_json_set_w_more_pairs():
85
85
)
86
86
87
87
88
- @ pytest . mark . parametrize (
89
- ( "series" , "json_path_value_pairs" ),
90
- [
91
- pytest . param (
92
- _get_series_from_json ([{ "a" : 10 }]),
93
- [( "$.a" , 1 , 100 )],
94
- id = "invalid_json_path_value_pairs" ,
95
- marks = pytest . mark . xfail ( raises = ValueError ),
96
- ),
97
- pytest . param (
88
+ def test_json_set_w_invalid_json_path_value_pairs ():
89
+ with pytest . raises ( ValueError ):
90
+ bbq . json_set (
91
+ _get_series_from_json ([{ "a" : 10 }]), json_path_value_pairs = [( "$.a" , 1 , 100 )] # type: ignore
92
+ )
93
+
94
+
95
+ def test_json_set_w_invalid_value_type ():
96
+ with pytest . raises ( TypeError ):
97
+ bbq . json_set (
98
98
_get_series_from_json ([{"a" : 10 }]),
99
- [
99
+ json_path_value_pairs = [
100
100
(
101
101
"$.a" ,
102
102
bpd .read_pandas (
103
103
gpd .GeoSeries .from_wkt (["POINT (1 2)" , "POINT (2 1)" ])
104
104
),
105
105
)
106
106
],
107
- id = "invalid_json_value_type" ,
108
- marks = pytest .mark .xfail (raises = TypeError ),
109
- ),
110
- pytest .param (
111
- bpd .Series ([1 , 2 ]),
112
- [("$.a" , 1 )],
113
- id = "invalid_series_type" ,
114
- marks = pytest .mark .xfail (raises = TypeError ),
115
- ),
116
- ],
117
- )
118
- def test_json_set_w_invalid (series , json_path_value_pairs ):
119
- bbq .json_set (series , json_path_value_pairs = json_path_value_pairs )
107
+ )
108
+
109
+
110
+ def test_json_set_w_invalid_series_type ():
111
+ with pytest .raises (TypeError ):
112
+ bbq .json_set (bpd .Series ([1 , 2 ]), json_path_value_pairs = [("$.a" , 1 )])
0 commit comments