Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gerlero committed Oct 17, 2024
1 parent a888513 commit 1e7c396
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 41 deletions.
40 changes: 11 additions & 29 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ macos = "11"

[dependencies]
pixi-pack = ">=0.1.8"
pytest = ">=7,<7.3"
pytest = ">=8.3.3"
pytest-asyncio-cooperative = ">=0.37.0"
foamlib = ">=0.6.0"
foamlib = ">=0.6.6"

[feature.openfoam.dependencies]
llvm-openmp = ">=19.1.1"
Expand Down
9 changes: 5 additions & 4 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
from foamlib import AsyncFoamCase

@pytest.fixture
async def pitz_case(tmp_path):
async def pitz():
case = AsyncFoamCase(Path(os.environ["FOAM_TUTORIALS"]) / "incompressible" / "simpleFoam" / "pitzDaily")
return await case.clone(tmp_path / case.name)
async with case.clone() as clone:
yield clone

@pytest.mark.asyncio_cooperative
async def test_pitz(pitz_case):
await pitz_case.run()
async def test_pitz(pitz):
await pitz.run()
5 changes: 3 additions & 2 deletions tests/test_foamy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from foamlib import AsyncFoamCase

@pytest.fixture
async def blob(tmp_path):
async def blob():
case = AsyncFoamCase(Path(os.environ["FOAM_TUTORIALS"]) / "mesh" / "foamyHexMesh" / "blob")
return await case.clone(tmp_path / case.name)
async with case.clone() as clone:
yield clone

@pytest.mark.parametrize("parallel", [False, True])
@pytest.mark.asyncio_cooperative
Expand Down
5 changes: 3 additions & 2 deletions tests/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from foamlib import AsyncFoamCase

@pytest.fixture
async def flange(tmp_path):
async def flange():
case = AsyncFoamCase(Path(os.environ["FOAM_TUTORIALS"]) / "basic" / "laplacianFoam" / "flange")
return await case.clone(tmp_path / case.name)
async with case.clone() as clone:
yield clone

@pytest.mark.asyncio_cooperative
async def test_serial(flange):
Expand Down
5 changes: 3 additions & 2 deletions tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
from foamlib import AsyncFoamCase

@pytest.fixture
async def step(tmp_path):
async def step():
case = AsyncFoamCase(Path(os.environ["FOAM_TUTORIALS"]) / "incompressible" / "simpleFoam" / "backwardFacingStep2D")
return await case.clone(tmp_path / case.name)
async with case.clone() as clone:
yield clone

@pytest.mark.asyncio_cooperative
async def test_step(step):
Expand Down

0 comments on commit 1e7c396

Please sign in to comment.