@@ -117,9 +117,10 @@ def test_success(self, yelp, faker, mock_request, random_dict):
117117
118118
119119class TestBusinessQuery :
120- def test_requires_id (self , yelp ):
120+ @pytest .mark .parametrize ('invalid_id' , [None , '' ])
121+ def test_requires_id (self , yelp , invalid_id ):
121122 with pytest .raises (ValueError ):
122- yelp .business_query (None )
123+ yelp .business_query (invalid_id )
123124
124125 def test_success (self , yelp , faker , mock_request , random_dict ):
125126 business_id = faker .pystr ()
@@ -156,9 +157,10 @@ def test_success(self, yelp, faker, mock_request, random_dict):
156157
157158
158159class TestEventLookupQuery :
159- def test_requires_id (self , yelp ):
160+ @pytest .mark .parametrize ('invalid_id' , [None , '' ])
161+ def test_requires_id (self , yelp , invalid_id ):
160162 with pytest .raises (ValueError ):
161- yelp .event_lookup_query (None )
163+ yelp .event_lookup_query (invalid_id )
162164
163165 def test_success (self , yelp , faker , mock_request , random_dict ):
164166 event_id = faker .pystr ()
@@ -197,9 +199,10 @@ def test_success(self, yelp, faker, mock_request, random_dict):
197199
198200
199201class TestReviewsQuery :
200- def test_requires_id (self , yelp ):
202+ @pytest .mark .parametrize ('invalid_id' , [None , '' ])
203+ def test_requires_id (self , yelp , invalid_id ):
201204 with pytest .raises (ValueError ):
202- yelp .reviews_query (None )
205+ yelp .reviews_query (invalid_id )
203206
204207 def test_success (self , yelp , faker , mock_request , random_dict ):
205208 business_id = faker .pystr ()
@@ -231,9 +234,10 @@ def test_success(self, yelp, faker, mock_request, random_dict):
231234
232235
233236class TestTransactionSearchQuery :
234- def test_requires_transaction_type (self , yelp , faker ):
237+ @pytest .mark .parametrize ('invalid_type' , [None , '' ])
238+ def test_requires_transaction_type (self , yelp , faker , invalid_type ):
235239 with pytest .raises (ValueError ):
236- yelp .transaction_search_query (None , location = faker .city ())
240+ yelp .transaction_search_query (invalid_type , location = faker .city ())
237241
238242 def test_requires_location_or_lat_lng (self , yelp , faker ):
239243 with pytest .raises (ValueError ):
0 commit comments