@@ -265,23 +265,23 @@ def test_smoke(data):
265265def test_absorbing_exceptions (random_gen ):
266266 absorbed = random_gen .standard_normal ((NOBS , 2 ))
267267 assert isinstance (absorbed , np .ndarray )
268- with pytest .raises (TypeError , match = "absorb must ba a DataFrame" ):
268+ with pytest .raises (TypeError , match = r "absorb must ba a DataFrame" ):
269269 AbsorbingLS (
270270 random_gen .standard_normal (NOBS ),
271271 random_gen .standard_normal ((NOBS , 2 )),
272272 absorb = absorbed ,
273273 )
274- with pytest .raises (ValueError , match = "ASDF" ):
274+ with pytest .raises (ValueError , match = r "ASDF" ):
275275 AbsorbingLS (
276276 random_gen .standard_normal (NOBS ), random_gen .standard_normal ((NOBS - 1 , 2 ))
277277 )
278- with pytest .raises (ValueError , match = "ASDF" ):
278+ with pytest .raises (ValueError , match = r "ASDF" ):
279279 AbsorbingLS (
280280 random_gen .standard_normal (NOBS ),
281281 random_gen .standard_normal ((NOBS , 2 )),
282282 absorb = pd .DataFrame (random_gen .standard_normal ((NOBS - 1 , 1 ))),
283283 )
284- with pytest .raises (ValueError , match = "ASDF" ):
284+ with pytest .raises (ValueError , match = r "ASDF" ):
285285 AbsorbingLS (
286286 random_gen .standard_normal (NOBS ),
287287 random_gen .standard_normal ((NOBS , 2 )),
@@ -298,7 +298,7 @@ def test_absorbing_exceptions(random_gen):
298298 assert isinstance (mod .absorbed_exog , pd .DataFrame )
299299 interactions = random_gen .randint (0 , 10 , size = (NOBS , 2 ))
300300 assert isinstance (interactions , np .ndarray )
301- with pytest .raises (TypeError , match = "ASDF" ):
301+ with pytest .raises (TypeError , match = r "ASDF" ):
302302 AbsorbingLS (
303303 random_gen .standard_normal (NOBS ),
304304 random_gen .standard_normal ((NOBS , 2 )),
@@ -346,15 +346,15 @@ def test_category_product_too_large(random_gen):
346346 for i in range (20 ):
347347 dfc [str (i )] = random_cat (10 , 1000 )
348348 cat = pd .DataFrame (dfc )
349- with pytest .raises (ValueError , match = "There are too many cats" ):
349+ with pytest .raises (ValueError , match = r "There are too many cats" ):
350350 category_product (cat )
351351
352352
353353def test_category_product_not_cat (random_gen ):
354354 cat = pd .DataFrame (
355355 {str (i ): pd .Series (random_gen .randint (0 , 10 , 1000 )) for i in range (3 )}
356356 )
357- with pytest .raises (TypeError , match = "cats must contain only" ):
357+ with pytest .raises (TypeError , match = r "cats must contain only" ):
358358 category_product (cat )
359359
360360
@@ -442,9 +442,9 @@ def test_interaction_from_frame(cat, cont):
442442
443443
444444def test_interaction_cat_bad_nobs ():
445- with pytest .raises (ValueError , match = "nobs must be provided when cat" ):
445+ with pytest .raises (ValueError , match = r "nobs must be provided when cat" ):
446446 Interaction ()
447- with pytest .raises (ValueError , match = "ASDF" ):
447+ with pytest .raises (ValueError , match = r "ASDF" ):
448448 Interaction (cat = np .empty ((100 , 0 )), cont = np .empty ((100 , 0 )))
449449
450450
@@ -704,7 +704,7 @@ def test_fully_absorb(random_gen):
704704 y = df .y
705705 x = pd .get_dummies (df .c , drop_first = False )
706706 mod = AbsorbingLS (y , x , absorb = df [["c" ]], drop_absorbed = True )
707- with pytest .raises (ValueError , match = "All columns in exog" ):
707+ with pytest .raises (ValueError , match = r "All columns in exog" ):
708708 mod .fit ()
709709
710710
@@ -719,9 +719,9 @@ def test_lsmr_options(random_gen):
719719 y = df .y
720720 x = df .iloc [:, :3 ]
721721 mod = AbsorbingLS (y , x , absorb = df [["c" ]], drop_absorbed = True )
722- with pytest .warns (FutureWarning , match = "lsmr_options" ):
722+ with pytest .warns (FutureWarning , match = r "lsmr_options" ):
723723 mod .fit (lsmr_options = {})
724- with pytest .raises (ValueError , match = "absorb_options cannot" ):
724+ with pytest .raises (ValueError , match = r "absorb_options cannot" ):
725725 mod .fit (lsmr_options = {}, absorb_options = {})
726726
727727
@@ -740,7 +740,7 @@ def test_options(random_gen):
740740 mod .fit (absorb_options = {"atol" : 1e-7 , "btol" : 1e-7 }, method = "lsmr" )
741741
742742 mod = AbsorbingLS (y , x [["x0" , "x1" ]], absorb = df [["x2" , "c" ]], drop_absorbed = True )
743- with pytest .raises (RuntimeError , match = "HDFE has been" ):
743+ with pytest .raises (RuntimeError , match = r "HDFE has been" ):
744744 mod .fit (absorb_options = {"atol" : 1e-7 , "btol" : 1e-7 }, method = "hdfe" )
745745
746746
0 commit comments