@@ -775,23 +775,29 @@ def test_nanbounds_eq_self(self):
775775 co1 = AuxCoord ([15.0 , 25.0 ], bounds = [[14.0 , 16.0 ], [24.0 , np .nan ]])
776776 assert co1 == co1
777777
778- def test_lazy_compares_via_hash (self ):
778+ @pytest .mark .parametrize ("bothlazy" , [True , False ], ids = ["bothlazy" , "onelazy" ])
779+ def test_lazy_compares_via_hash (self , bothlazy ):
779780 def lazify (coord ):
780781 coord .bounds = coord .lazy_bounds ()
781782
782783 co1 = AuxCoord ([15.0 , 25.0 ])
783784 co2 = AuxCoord ([15.0 , 25.001 ])
785+
784786 co1 .points = co1 .lazy_points ()
785- co2 .points = co2 .lazy_points ()
787+ if bothlazy :
788+ co2 .points = co2 .lazy_points ()
786789 assert co1 .has_lazy_points ()
787- assert co2 .has_lazy_points ()
790+ assert co2 .has_lazy_points () == bothlazy
791+
788792 assert not hasattr (co1 .core_points (), "_iris_array_hash" )
789- assert not hasattr (co2 .core_points (), "_iris_array_hash" )
793+ if bothlazy :
794+ assert not hasattr (co2 .core_points (), "_iris_array_hash" )
790795
791796 eq = co1 == co2
792797 assert not eq
793798
794799 assert co1 .has_lazy_points ()
795- assert co2 .has_lazy_points ()
796800 assert hasattr (co1 .core_points (), "_iris_array_hash" )
797- assert hasattr (co2 .core_points (), "_iris_array_hash" )
801+ if bothlazy :
802+ assert co2 .has_lazy_points ()
803+ assert hasattr (co2 .core_points (), "_iris_array_hash" )
0 commit comments