Skip to content

Commit ac9fdd1

Browse files
authored
tests: Speed up test_batch_run (#2039)
* tests: Speed up test_batch_run * ci: Print 10 slowest unit tests
1 parent 0c35956 commit ac9fdd1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/build_lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: Install Mesa
7474
run: pip install --no-deps .
7575
- name: Test with pytest
76-
run: pytest --cov=mesa tests/ --cov-report=xml
76+
run: pytest --durations=10 --cov=mesa tests/ --cov-report=xml
7777
- if: matrix.os == 'ubuntu'
7878
name: Codecov
7979
uses: codecov/codecov-action@v4

tests/test_batch_run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ def test_batch_run_with_params():
124124
mesa.batch_run(
125125
MockModel,
126126
{
127-
"variable_model_params": range(5),
128-
"variable_agent_params": ["H", "E", "L", "L", "O"],
127+
"variable_model_params": range(3),
128+
"variable_agent_params": ["H", "E", "Y"],
129129
},
130130
number_processes=2,
131131
)
@@ -148,7 +148,7 @@ def test_batch_run_no_agent_reporters():
148148

149149

150150
def test_batch_run_single_core():
151-
mesa.batch_run(MockModel, {}, number_processes=1, iterations=10)
151+
mesa.batch_run(MockModel, {}, number_processes=1, iterations=6)
152152

153153

154154
def test_batch_run_unhashable_param():

0 commit comments

Comments
 (0)