Skip to content

Commit

Permalink
Convert LocalPath to str, keep tmpdir from pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
berland committed Feb 25, 2020
1 parent cc8d707 commit 763d49e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tests/test_convert_grid_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,19 @@
def test_convert_grid_format_egrid(tmpdir):
"""Convert an ECLIPSE egrid to roff"""

outfile = os.path.join(tmpdir, "reek_grid.roff")
outfile = os.path.join(str(tmpdir), "reek_grid.roff")

cgf.main(["--file", RFILE1, "--output", outfile, "--mode", "grid", "--standardfmu"])

# check number of active cells
gg = xtgeo.Grid(outfile)
assert gg.nactive == 35817

shutil.rmtree(tmpdir)


def test_convert_grid_format_restart(tmpdir):
"""Convert an ECLIPSE SOIL from restart to roff"""

outfile = os.path.join(tmpdir, "reek_grid.roff")
outfile = os.path.join(str(tmpdir), "reek_grid.roff")

cgf.main(
[
Expand All @@ -56,10 +54,8 @@ def test_convert_grid_format_restart(tmpdir):
]
)

actual_outfile = os.path.join(tmpdir, "reek_grid--soil--20000701.roff")
actual_outfile = os.path.join(str(tmpdir), "reek_grid--soil--20000701.roff")

gprop = xtgeo.GridProperty(actual_outfile)

assert gprop.values.mean() == pytest.approx(0.0857, abs=0.001)

shutil.rmtree(tmpdir)

0 comments on commit 763d49e

Please sign in to comment.