@@ -104,13 +104,14 @@ def _create_empty_mdio(cls, create_headers: bool, output_path: Path, overwrite:
104104 # The HeaderSpec can be either standard or customized.
105105 headers = get_teapot_segy_spec ().trace .header if create_headers else None
106106 # Create an empty MDIO v1 metric post-stack 3D time velocity dataset
107- create_empty (
107+ xr_dataset = create_empty (
108108 mdio_template = PostStack3DVelocityTemplate (data_domain = "time" , is_metric = True ),
109109 dimensions = dims ,
110110 output_path = output_path ,
111111 headers = headers ,
112112 overwrite = overwrite ,
113113 )
114+ return xr_dataset
114115
115116 @classmethod
116117 def validate_teapod_dataset_metadata (cls , ds : xr_Dataset , is_velocity : bool ) -> None :
@@ -203,7 +204,8 @@ def mdio_with_headers(self, empty_mdio_dir: Path) -> Path:
203204 and shared across all test methods in the class.
204205 """
205206 empty_mdio : Path = empty_mdio_dir / "mdio_with_headers.mdio"
206- self ._create_empty_mdio (create_headers = True , output_path = empty_mdio )
207+ xr_dataset = self ._create_empty_mdio (create_headers = True , output_path = empty_mdio )
208+ assert xr_dataset is not None
207209 return empty_mdio
208210
209211 @pytest .fixture (scope = "class" )
@@ -214,7 +216,8 @@ def mdio_no_headers(self, empty_mdio_dir: Path) -> Path:
214216 and shared across all test methods in the class.
215217 """
216218 empty_mdio : Path = empty_mdio_dir / "mdio_no_headers.mdio"
217- self ._create_empty_mdio (create_headers = False , output_path = empty_mdio )
219+ xr_dataset = self ._create_empty_mdio (create_headers = False , output_path = empty_mdio )
220+ assert xr_dataset is not None
218221 return empty_mdio
219222
220223 def test_dataset_metadata (self , mdio_with_headers : Path ) -> None :
@@ -251,7 +254,8 @@ def test_overwrite_behavior(self, empty_mdio_dir: Path) -> None:
251254 self ._create_empty_mdio (create_headers = True , output_path = empty_mdio , overwrite = False )
252255
253256 # Third call: Create MDIO with overwrite=True - should succeed and overwrite garbage
254- self ._create_empty_mdio (create_headers = True , output_path = empty_mdio , overwrite = True )
257+ xr_dataset = self ._create_empty_mdio (create_headers = True , output_path = empty_mdio , overwrite = True )
258+ assert xr_dataset is not None
255259
256260 # Validate that the MDIO file can be loaded correctly using the helper function
257261 ds = open_mdio (empty_mdio )
@@ -398,6 +402,8 @@ def test_create_empty_like(self, teapot_mdio_tmp: Path, empty_mdio_dir: Path) ->
398402 keep_coordinates = True ,
399403 overwrite = True ,
400404 )
405+ assert ds is not None
406+
401407 self .validate_teapod_dataset_metadata (ds , is_velocity = False )
402408 header_dtype = get_teapot_segy_spec ().trace .header .dtype
403409 self .validate_teapod_dataset_variables (ds , header_dtype = header_dtype , is_velocity = False )
0 commit comments