@@ -811,7 +811,7 @@ def test_lazy_tractogram_creation(self):
811811
812812 # Empty `LazyTractogram`
813813 tractogram = LazyTractogram ()
814- with pytest .warns (Warning ):
814+ with pytest .warns (Warning , match = "Number of streamlines will be determined manually" ):
815815 check_tractogram (tractogram )
816816 assert tractogram .affine_to_rasmm is None
817817
@@ -833,7 +833,7 @@ def test_lazy_tractogram_creation(self):
833833 def test_lazy_tractogram_from_data_func (self ):
834834 # Create an empty `LazyTractogram` yielding nothing.
835835 tractogram = LazyTractogram .from_data_func (lambda : iter ([]))
836- with pytest .warns (Warning ):
836+ with pytest .warns (Warning , match = "Number of streamlines will be determined manually" ):
837837 check_tractogram (tractogram )
838838
839839 # Create `LazyTractogram` from a generator function yielding
@@ -854,7 +854,7 @@ def _data_gen():
854854 data_for_points )
855855
856856 tractogram = LazyTractogram .from_data_func (_data_gen )
857- with pytest .warns (Warning ):
857+ with pytest .warns (Warning , match = "Number of streamlines will be determined manually" ):
858858 assert_tractogram_equal (tractogram , DATA ['tractogram' ])
859859
860860 # Creating a LazyTractogram from not a corouting should raise an error.
@@ -924,7 +924,7 @@ def test_lazy_tractogram_apply_affine(self):
924924 assert_array_equal (transformed_tractogram ._affine_to_apply , affine )
925925 assert_array_equal (transformed_tractogram .affine_to_rasmm ,
926926 np .dot (np .eye (4 ), np .linalg .inv (affine )))
927- with pytest .warns (Warning ):
927+ with pytest .warns (Warning , match = "Number of streamlines will be determined manually" ):
928928 check_tractogram (transformed_tractogram ,
929929 streamlines = [s * scaling for s in DATA ['streamlines' ]],
930930 data_per_streamline = DATA ['data_per_streamline' ],
@@ -950,7 +950,7 @@ def test_lazy_tractogram_apply_affine(self):
950950 transformed_tractogram = tractogram .apply_affine (affine )
951951 assert_array_equal (transformed_tractogram ._affine_to_apply , affine )
952952 assert transformed_tractogram .affine_to_rasmm is None
953- with pytest .warns (Warning ):
953+ with pytest .warns (Warning , match = "Number of streamlines will be determined manually" ):
954954 check_tractogram (transformed_tractogram ,
955955 streamlines = [s * scaling for s in DATA ['streamlines' ]],
956956 data_per_streamline = DATA ['data_per_streamline' ],
@@ -1024,5 +1024,5 @@ def test_lazy_tractogram_copy(self):
10241024 DATA ['lazy_tractogram' ]._affine_to_apply )
10251025
10261026 # Check the data are the equivalent.
1027- with pytest .warns (Warning ):
1027+ with pytest .warns (Warning , match = "Number of streamlines will be determined manually" ):
10281028 assert_tractogram_equal (tractogram , DATA ['tractogram' ])
0 commit comments