@@ -286,7 +286,7 @@ def export_masked_path(tmp_path_factory: pytest.TempPathFactory, raw_headers_env
286286 """Fixture that generates temp directory for export tests."""
287287 # Create path suffix based on current raw headers environment variable
288288 # raw_headers_env dependency ensures the environment variable is set before this runs
289- raw_headers_enabled = os .getenv ("MDIO__DO_RAW_HEADERS " ) == "1"
289+ raw_headers_enabled = os .getenv ("MDIO__IMPORT__RAW_HEADERS " ) in ( "1" , "true" , "yes" , "on" )
290290 path_suffix = "with_raw_headers" if raw_headers_enabled else "without_raw_headers"
291291
292292 if DEBUG_MODE :
@@ -296,17 +296,17 @@ def export_masked_path(tmp_path_factory: pytest.TempPathFactory, raw_headers_env
296296
297297@pytest .fixture
298298def raw_headers_env (request : pytest .FixtureRequest ) -> None :
299- """Fixture to set/unset MDIO__DO_RAW_HEADERS environment variable."""
299+ """Fixture to set/unset MDIO__IMPORT__RAW_HEADERS environment variable."""
300300 env_value = request .param
301301 if env_value is not None :
302- os .environ ["MDIO__DO_RAW_HEADERS " ] = env_value
302+ os .environ ["MDIO__IMPORT__RAW_HEADERS " ] = env_value
303303 else :
304- os .environ .pop ("MDIO__DO_RAW_HEADERS " , None )
304+ os .environ .pop ("MDIO__IMPORT__RAW_HEADERS " , None )
305305
306306 yield
307307
308308 # Cleanup after test - both environment variable and template state
309- os .environ .pop ("MDIO__DO_RAW_HEADERS " , None )
309+ os .environ .pop ("MDIO__IMPORT__RAW_HEADERS " , None )
310310
311311 # Clean up any template modifications to ensure test isolation
312312 registry = TemplateRegistry .get_instance ()
@@ -513,7 +513,7 @@ def test_raw_headers_byte_preservation(
513513 export_masked_path : Path ,
514514 raw_headers_env : None , # noqa: ARG002
515515 ) -> None :
516- """Test that raw headers are preserved byte-for-byte when MDIO__DO_RAW_HEADERS =1."""
516+ """Test that raw headers are preserved byte-for-byte when MDIO__IMPORT__RAW_HEADERS =1."""
517517 grid_conf , segy_factory_conf , _ , _ = test_conf
518518 segy_path = export_masked_path / f"{ grid_conf .name } .sgy"
519519 mdio_path = export_masked_path / f"{ grid_conf .name } .mdio"
@@ -523,10 +523,12 @@ def test_raw_headers_byte_preservation(
523523
524524 # Check if raw_headers should exist based on environment variable
525525 has_raw_headers = "raw_headers" in ds .data_vars
526- if os .getenv ("MDIO__DO_RAW_HEADERS " ) == "1" :
527- assert has_raw_headers , "raw_headers should be present when MDIO__DO_RAW_HEADERS =1"
526+ if os .getenv ("MDIO__IMPORT__RAW_HEADERS " ) in ( "1" , "true" , "yes" , "on" ) :
527+ assert has_raw_headers , "raw_headers should be present when MDIO__IMPORT__RAW_HEADERS =1"
528528 else :
529- assert not has_raw_headers , f"raw_headers should not be present when MDIO__DO_RAW_HEADERS is not set\n { ds } "
529+ assert not has_raw_headers , (
530+ f"raw_headers should not be present when MDIO__IMPORT__RAW_HEADERS is not set\n { ds } "
531+ )
530532 return # Exit early if raw_headers are not expected
531533
532534 # Get data (only if raw_headers exist)
0 commit comments