Skip to content

Commit

Permalink
Merge pull request #282 from gerlero/tests
Browse files Browse the repository at this point in the history
Update tests for foamlib 0.6
  • Loading branch information
gerlero authored Sep 30, 2024
2 parents 3cdfe54 + 548d732 commit dc9dec3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pytest>=7,<7.3
pytest-asyncio-cooperative>=0.37.0,<0.38
foamlib>=0.1.0,<0.7.0
foamlib>=0.6.0,<0.7.0
9 changes: 4 additions & 5 deletions tests/test_parallel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest

import os
import shutil
from pathlib import Path

from foamlib import AsyncFoamCase
Expand All @@ -18,15 +17,15 @@ async def test_serial(flange):
@pytest.mark.asyncio_cooperative
async def test_parallel(flange):
await flange.run(parallel=True)
await flange.run(["reconstructPar"])
await flange.reconstruct_par()

@pytest.mark.asyncio_cooperative
async def test_parallel_manual(flange):
shutil.copytree(flange.path / "0.orig", flange.path / "0")
await flange.restore_0_dir()
await flange.run(["ansysToFoam", Path(os.environ["FOAM_TUTORIALS"]) / "resources" / "geometry" / "flange.ans", "-scale", "0.001"])
await flange.run(["decomposePar"])
await flange.decompose_par()
await flange.run([flange.application], parallel=True)
await flange.run(["reconstructPar"])
await flange.reconstruct_par()

@pytest.mark.asyncio_cooperative
async def test_parallel_manual_shell(flange):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ async def test_step(step):
await step.run()
assert "FOAM Warning" not in (step.path / "log.simpleFoam").read_text()

@pytest.mark.skipif(int(os.environ["FOAM_API"]) > 2312, reason="cartesianMesh removed from default installation")
def test_cartesian(): # https://github.com/gerlero/openfoam-app/issues/88
@pytest.mark.skipif(int(os.environ["FOAM_API"]) > 2312, reason="cfMesh removed from default installation")
def test_cf_mesh(): # https://github.com/gerlero/openfoam-app/issues/88
subprocess.run(["cartesianMesh", "-help"], check=True)

0 comments on commit dc9dec3

Please sign in to comment.