Skip to content

tests: Speed up test_batch_run #2039

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Install Mesa
run: pip install --no-deps .
- name: Test with pytest
run: pytest --cov=mesa tests/ --cov-report=xml
run: pytest --durations=10 --cov=mesa tests/ --cov-report=xml
- if: matrix.os == 'ubuntu'
name: Codecov
uses: codecov/codecov-action@v4
Expand Down
6 changes: 3 additions & 3 deletions tests/test_batch_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def test_batch_run_with_params():
mesa.batch_run(
MockModel,
{
"variable_model_params": range(5),
"variable_agent_params": ["H", "E", "L", "L", "O"],
"variable_model_params": range(3),
"variable_agent_params": ["H", "E", "Y"],
},
number_processes=2,
)
Expand All @@ -148,7 +148,7 @@ def test_batch_run_no_agent_reporters():


def test_batch_run_single_core():
mesa.batch_run(MockModel, {}, number_processes=1, iterations=10)
mesa.batch_run(MockModel, {}, number_processes=1, iterations=6)


def test_batch_run_unhashable_param():
Expand Down