1
1
"""Test Batchrunner."""
2
2
3
- import mesa
4
3
from mesa .agent import Agent
5
- from mesa .batchrunner import _make_model_kwargs
4
+ from mesa .batchrunner import _make_model_kwargs , batch_run
6
5
from mesa .datacollection import DataCollector
7
6
from mesa .model import Model
8
7
from mesa .time import BaseScheduler
@@ -103,7 +102,7 @@ def step(self): # noqa: D102
103
102
104
103
105
104
def test_batch_run (): # noqa: D103
106
- result = mesa . batch_run (MockModel , {}, number_processes = 2 )
105
+ result = batch_run (MockModel , {}, number_processes = 2 )
107
106
assert result == [
108
107
{
109
108
"RunId" : 0 ,
@@ -136,7 +135,7 @@ def test_batch_run(): # noqa: D103
136
135
137
136
138
137
def test_batch_run_with_params (): # noqa: D103
139
- mesa . batch_run (
138
+ batch_run (
140
139
MockModel ,
141
140
{
142
141
"variable_model_params" : range (3 ),
@@ -147,9 +146,7 @@ def test_batch_run_with_params(): # noqa: D103
147
146
148
147
149
148
def test_batch_run_no_agent_reporters (): # noqa: D103
150
- result = mesa .batch_run (
151
- MockModel , {"enable_agent_reporters" : False }, number_processes = 2
152
- )
149
+ result = batch_run (MockModel , {"enable_agent_reporters" : False }, number_processes = 2 )
153
150
print (result )
154
151
assert result == [
155
152
{
@@ -163,11 +160,11 @@ def test_batch_run_no_agent_reporters(): # noqa: D103
163
160
164
161
165
162
def test_batch_run_single_core (): # noqa: D103
166
- mesa . batch_run (MockModel , {}, number_processes = 1 , iterations = 6 )
163
+ batch_run (MockModel , {}, number_processes = 1 , iterations = 6 )
167
164
168
165
169
166
def test_batch_run_unhashable_param (): # noqa: D103
170
- result = mesa . batch_run (
167
+ result = batch_run (
171
168
MockModel ,
172
169
{
173
170
"n_agents" : 2 ,
0 commit comments