Using Bots (test.py) in the new no-self format

200 views
Skip to first unread message

Andreas

unread,
Mar 16, 2021, 10:45:49 AM3/16/21
to oTree help & discussion

Dear All, Dear Chris,

I am coding my first app and I am quite new to otree. I apologize in advance if the question is easy to answer, but I couldn't find a solution.

I am puzzled with the question of how to code Bots with the new no-self format.

The otree page states that:

"In oTree Studio, go to the “Tests” section of your app. Click the button to auto-write bots code. If you want to refine the code that was generated (such as adding expect() statements), read the below sections. If you are using a text editor, go to tests.py."

I am using pycharm. So, I am looking for the tests.py, right? However, I can not find it in my app.

Looking at published experiments on otreehub, I see that test.py was on the same level as models.py and page.py in the old format.

Eg.
models.py
pages.py
tests.py

If I create an app in the new no-self format I only have __init__.py and some test pages.

Thank you for your help.

Best,
Andreas

Chris @ oTree

unread,
Mar 16, 2021, 10:59:48 AM3/16/21
to oTree help & discussion
The bots format is still the same, although the imports at the top change a bit: https://github.com/oTree-org/oTree/blob/lite/cournot/tests.py

Andreas

unread,
Mar 16, 2021, 11:10:29 AM3/16/21
to oTree help & discussion
Dear Chris,

thanks a lot for your quick response.

Best,
Andreas
Reply all
Reply to author
Forward
0 new messages