Skip to content

Commit

Permalink
Merge pull request #87 from gerlero/tests
Browse files Browse the repository at this point in the history
Update tests for pytest-asyncio-cooperative 0.34.0
  • Loading branch information
gerlero authored Dec 4, 2023
2 parents a870523 + 925ef6a commit 6ac2a3e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tests/test_dispersion/test_dispersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async def dispersion_case(run_case):


@pytest.mark.asyncio_cooperative
async def test_dispersion(dispersion_case):
def test_dispersion(dispersion_case):
alphaT = 5e-5

field = np.asarray(dispersion_case["50"]["ampholyte.TARTRAZINE"].getContent()["internalField"].value())
Expand Down
6 changes: 3 additions & 3 deletions tests/test_exhaustible/test_exhaustible.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async def exhaustible_case(run_case):


@pytest.mark.asyncio_cooperative
async def test_exhaustion(exhaustible_case):
def test_exhaustion(exhaustible_case):
assert len(exhaustible_case.times) >= 4

remainings = []
Expand All @@ -35,7 +35,7 @@ async def test_exhaustion(exhaustible_case):
assert all(prev >= curr for prev, curr in zip(remainings[:-1], remainings[1:]))

@pytest.mark.asyncio_cooperative
async def test_infiltration(exhaustible_case):
def test_infiltration(exhaustible_case):
theta0 = np.asarray(exhaustible_case[0]["theta"].getContent()["internalField"].value())
dV = 30e-3*10e-3*0.18e-3/5000
amount = 2e-8
Expand All @@ -53,7 +53,7 @@ async def test_infiltration(exhaustible_case):
assert np.sum(theta - theta0)*dV + remaining == pytest.approx(amount)

@pytest.mark.asyncio_cooperative
async def test_exhausted_log(exhaustible_case):
def test_exhausted_log(exhaustible_case):
log = (Path(exhaustible_case.name) / "log.moistureDiffusivityFoam").read_text()

assert log.count("patch left has been exhausted") == 1
2 changes: 1 addition & 1 deletion tests/test_parallelization/test_parallelization.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async def parallel_case(run_case):

@pytest.mark.asyncio_cooperative
@pytest.mark.parametrize("field", ["theta", "U", "C"])
async def test_parallelization(serial_case, parallel_case, field):
def test_parallelization(serial_case, parallel_case, field):
assert len(serial_case.times) == len(parallel_case.times) > 1

for t in serial_case.times[1:]:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_reaction/test_reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async def reaction_case(run_case):


@pytest.mark.asyncio_cooperative
async def test_reaction(reaction_case):
def test_reaction(reaction_case):
a0 = np.asarray(reaction_case["0"]["A"].getContent()["internalField"].value())
b0 = np.asarray(reaction_case["0"]["B"].getContent()["internalField"].value())
c0 = np.asarray(reaction_case["0"]["C"].getContent()["internalField"].value())
Expand Down
2 changes: 1 addition & 1 deletion tests/test_retardation/test_retardation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async def retardation_case(run_case):


@pytest.mark.asyncio_cooperative
async def test_retardation(retardation_case):
def test_retardation(retardation_case):
a5 = retardation_case["5"]["A"].getContent()["internalField"].value()
b10 = retardation_case["10"]["B"].getContent()["internalField"].value()

Expand Down
4 changes: 2 additions & 2 deletions tests/test_validity/test_validity.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ async def letd_case(run_case):


@pytest.mark.asyncio_cooperative
async def test_letxs(letxs_case):
def test_letxs(letxs_case):
actual = letxs_case["100"]["theta"].getContent()["internalField"].value()
expected = letxs_case["100"]["theta.expected"].getContent()["internalField"].value()

assert actual == pytest.approx(expected, abs=5e-2)

@pytest.mark.asyncio_cooperative
async def test_letd(letd_case):
def test_letd(letd_case):
actual = letd_case["100"]["theta"].getContent()["internalField"].value()
expected = letd_case["100"]["theta.expected"].getContent()["internalField"].value()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_velocity/test_velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async def velocity_case(run_case):


@pytest.mark.asyncio_cooperative
async def test_infiltration(velocity_case):
def test_infiltration(velocity_case):
theta0 = np.asarray(velocity_case[0]["theta"].getContent()["internalField"].value())
U = velocity_case[0]["U"].getContent()["boundaryField"]["left"]["value"].value()[0]
h = 30e-3/5000
Expand Down

0 comments on commit 6ac2a3e

Please sign in to comment.