@@ -2118,7 +2118,7 @@ def test_ngff_omero_below_min_version(tmp_path):
21182118 wsireader .WSIReader .open (sample_copy )
21192119
21202120
2121- def test_ngff_omero_above_max_version (tmp_path ):
2121+ def test_ngff_omero_above_max_version (tmp_path , caplog ):
21222122 """Test for FileNotSupported when omero version is above maximum."""
21232123 sample = _fetch_remote_sample ("ngff-1" )
21242124 # Create a copy of the sample
@@ -2130,8 +2130,10 @@ def test_ngff_omero_above_max_version(tmp_path):
21302130 zattrs ["omero" ]["version" ] = "10.0"
21312131 with open (sample_copy / ".zattrs" , "w" ) as fh :
21322132 json .dump (zattrs , fh , indent = 2 )
2133- with pytest .raises (FileNotSupported ):
2133+ # Check that the warning is logged
2134+ with caplog .at_level (logging .WARNING ):
21342135 wsireader .WSIReader .open (sample_copy )
2136+ assert "maximum supported version" in caplog .text
21352137
21362138
21372139def test_ngff_multiscales_below_min_version (tmp_path ):
@@ -2150,7 +2152,7 @@ def test_ngff_multiscales_below_min_version(tmp_path):
21502152 wsireader .WSIReader .open (sample_copy )
21512153
21522154
2153- def test_ngff_multiscales_above_max_version (tmp_path ):
2155+ def test_ngff_multiscales_above_max_version (tmp_path , caplog ):
21542156 """Test for FileNotSupported when multiscales version is above maximum."""
21552157 sample = _fetch_remote_sample ("ngff-1" )
21562158 # Create a copy of the sample
@@ -2162,8 +2164,10 @@ def test_ngff_multiscales_above_max_version(tmp_path):
21622164 zattrs ["multiscales" ][0 ]["version" ] = "10.0"
21632165 with open (sample_copy / ".zattrs" , "w" ) as fh :
21642166 json .dump (zattrs , fh , indent = 2 )
2165- with pytest .raises (FileNotSupported ):
2167+ # Check that the warning is logged
2168+ with caplog .at_level (logging .WARNING ):
21662169 wsireader .WSIReader .open (sample_copy )
2170+ assert "maximum supported version" in caplog .text
21672171
21682172
21692173def test_ngff_non_numeric_version (tmp_path , monkeypatch ):
0 commit comments