Skip to content

Commit

Permalink
TST: Skip dataio export tests on Windows
Browse files Browse the repository at this point in the history
dataio uses `NamedTemporaryFile` to generate a temporary file on which a
file hash is calculated. This Python library function lacks good
portability to Windows.
  • Loading branch information
mferrera committed Jun 17, 2024
1 parent 06a11e1 commit da022d3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_scripts/test_grid3d_average_map_dataio1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import os
import shutil
import sys
from pathlib import Path

import pytest
Expand Down Expand Up @@ -115,6 +116,9 @@ def test_average_map_1a_legacy(datatree):
assert out.is_file()


@pytest.mark.skipif(
sys.platform == "win32", reason="dataio currently uses NamedTemporaryFile"
)
def test_average_map_dataio1a(datatree, avgdataio1aconfig):
"""Test AVG with YAML config example 3a piped through dataio"""

Expand Down
4 changes: 4 additions & 0 deletions tests/test_scripts/test_grid3d_hc_thickness_dataio1a.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import os
import shutil
import sys
from pathlib import Path

import grid3d_maps.avghc.grid3d_hc_thickness as grid3d_hc_thickness
Expand Down Expand Up @@ -67,6 +68,9 @@ def test_hc_thickness_1a_add2docs(hcdataio1aconfig):
assert hcdataio1aconfig is not None


@pytest.mark.skipif(
sys.platform == "win32", reason="dataio currently uses NamedTemporaryFile"
)
def test_hc_thickness_1a(datatree, hcdataio1aconfig):
"""Test HC thickness map piped through dataio"""

Expand Down
4 changes: 4 additions & 0 deletions tests/test_scripts/test_grid3d_hc_thickness_dataio1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import os
import shutil
import sys
from pathlib import Path

import grid3d_maps.avghc.grid3d_hc_thickness as grid3d_hc_thickness
Expand Down Expand Up @@ -66,6 +67,9 @@ def test_hc_thickness_1b_add2docs(hcdataio1bconfig):
assert hcdataio1bconfig is not None


@pytest.mark.skipif(
sys.platform == "win32", reason="dataio currently uses NamedTemporaryFile"
)
def test_hc_thickness_1b(datatree, hcdataio1bconfig):
"""Test HC thickness map piped through dataio, using 'both' mode"""

Expand Down
4 changes: 4 additions & 0 deletions tests/test_scripts/test_grid3d_hc_thickness_dataio1c.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import os
import shutil
import sys
from pathlib import Path

import grid3d_maps.avghc.grid3d_hc_thickness as grid3d_hc_thickness
Expand Down Expand Up @@ -66,6 +67,9 @@ def test_hc_thickness_1c_add2docs(hcdataio1cconfig):
assert hcdataio1cconfig is not None


@pytest.mark.skipif(
sys.platform == "win32", reason="dataio currently uses NamedTemporaryFile"
)
@pytest.mark.parametrize(
"variant",
["inputconfig", "FMU_GLOBAL_CONFIG_GRD3DMAPS", "FMU_GLOBAL_CONFIG"],
Expand Down

0 comments on commit da022d3

Please sign in to comment.