@@ -449,37 +449,6 @@ def test__get_params(self, fill, side_range):
449449 assert 0 <= params ["padding" ][3 ] <= (side_range [1 ] - 1 ) * h
450450
451451
452- class TestGaussianBlur :
453- def test_assertions (self ):
454- with pytest .raises (ValueError , match = "Kernel size should be a tuple/list of two integers" ):
455- transforms .GaussianBlur ([10 , 12 , 14 ])
456-
457- with pytest .raises (ValueError , match = "Kernel size value should be an odd and positive number" ):
458- transforms .GaussianBlur (4 )
459-
460- with pytest .raises (
461- TypeError , match = "sigma should be a single int or float or a list/tuple with length 2 floats."
462- ):
463- transforms .GaussianBlur (3 , sigma = [1 , 2 , 3 ])
464-
465- with pytest .raises (ValueError , match = "If sigma is a single number, it must be positive" ):
466- transforms .GaussianBlur (3 , sigma = - 1.0 )
467-
468- with pytest .raises (ValueError , match = "sigma values should be positive and of the form" ):
469- transforms .GaussianBlur (3 , sigma = [2.0 , 1.0 ])
470-
471- @pytest .mark .parametrize ("sigma" , [10.0 , [10.0 , 12.0 ]])
472- def test__get_params (self , sigma ):
473- transform = transforms .GaussianBlur (3 , sigma = sigma )
474- params = transform ._get_params ([])
475-
476- if isinstance (sigma , float ):
477- assert params ["sigma" ][0 ] == params ["sigma" ][1 ] == 10
478- else :
479- assert sigma [0 ] <= params ["sigma" ][0 ] <= sigma [1 ]
480- assert sigma [0 ] <= params ["sigma" ][1 ] <= sigma [1 ]
481-
482-
483452class TestRandomPerspective :
484453 def test_assertions (self ):
485454 with pytest .raises (ValueError , match = "Argument distortion_scale value should be between 0 and 1" ):
@@ -503,24 +472,18 @@ def test__get_params(self):
503472class TestElasticTransform :
504473 def test_assertions (self ):
505474
506- with pytest .raises (TypeError , match = "alpha should be float or a sequence of floats " ):
475+ with pytest .raises (TypeError , match = "alpha should be a number or a sequence of numbers " ):
507476 transforms .ElasticTransform ({})
508477
509- with pytest .raises (ValueError , match = "alpha is a sequence its length should be one of 2" ):
478+ with pytest .raises (ValueError , match = "alpha is a sequence its length should be 1 or 2" ):
510479 transforms .ElasticTransform ([1.0 , 2.0 , 3.0 ])
511480
512- with pytest .raises (ValueError , match = "alpha should be a sequence of floats" ):
513- transforms .ElasticTransform ([1 , 2 ])
514-
515- with pytest .raises (TypeError , match = "sigma should be float or a sequence of floats" ):
481+ with pytest .raises (TypeError , match = "sigma should be a number or a sequence of numbers" ):
516482 transforms .ElasticTransform (1.0 , {})
517483
518- with pytest .raises (ValueError , match = "sigma is a sequence its length should be one of 2" ):
484+ with pytest .raises (ValueError , match = "sigma is a sequence its length should be 1 or 2" ):
519485 transforms .ElasticTransform (1.0 , [1.0 , 2.0 , 3.0 ])
520486
521- with pytest .raises (ValueError , match = "sigma should be a sequence of floats" ):
522- transforms .ElasticTransform (1.0 , [1 , 2 ])
523-
524487 with pytest .raises (TypeError , match = "Got inappropriate fill arg" ):
525488 transforms .ElasticTransform (1.0 , 2.0 , fill = "abc" )
526489
0 commit comments