Skip to content

Commit

Permalink
limit retries
Browse files Browse the repository at this point in the history
  • Loading branch information
mike8699 committed Oct 7, 2024
1 parent ce6d540 commit 02693ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion tests/desmume/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,19 @@ def desmume_instance(request):
desmume_emulator.destroy()


@pytest.fixture
@pytest.fixture(
params=[
pytest.param(
None,
# Rerun the test up to 5 times if it fails with an OSError.
# This is useful for MelonDS-based tests, which are flaky.
marks=pytest.mark.flaky(
reruns=5,
only_rerun=['OSError'],
),
)
]
)
def desmume_emulator(
desmume_instance: AbstractEmulatorWrapper, rom_path: Path
) -> Generator[AbstractEmulatorWrapper, Any, None]:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extras =
test
desmume
commands =
pytest --melonds --numprocesses auto --reruns 5 {posargs} tests/desmume
pytest --melonds --numprocesses auto {posargs} tests/desmume

[testenv:build]
extras =
Expand Down

0 comments on commit 02693ab

Please sign in to comment.