mesa icon indicating copy to clipboard operation
mesa copied to clipboard

JupyterViz: Add tests

Open rht opened this issue 2 years ago • 16 comments

See https://github.com/widgetti/solara/tree/master/tests/unit and https://github.com/widgetti/solara/tree/master/tests/integration for inspiration.

rht avatar Aug 28 '23 09:08 rht

The integration test should be easier, because it's basically just running a Solara app and ensures that it doesn't error out. @ankitk50 this should be a low-hanging fruit.

rht avatar Aug 28 '23 09:08 rht

Thanks, I see that there are unittests for each UI element. So the idea would be to create a unittest where we test each element of the JupyterViz. I add this to my To-Do.

ankitk50 avatar Aug 28 '23 10:08 ankitk50

@rht Is this issue still open to be fixed or has it been assigned already? I am available to work on building these tests.

ameyakhot avatar Jun 17 '24 22:06 ameyakhot

Yes it is still open, and a high priority one.

rht avatar Jun 18 '24 02:06 rht

I will take this up for now. I just have one question. /mesa/tests/test_jupyter_viz.py is the file that is to be altered with unit and integration tests for the elements of JupyterViz. Is that right?

Just clarifying before starting to work.

ameyakhot avatar Jun 18 '24 03:06 ameyakhot

That's right. To disambiguate, this file: https://github.com/projectmesa/mesa/blob/main/tests/test_jupyter_viz.py.

rht avatar Jun 18 '24 06:06 rht

@rht On it.

ameyakhot avatar Jun 19 '24 00:06 ameyakhot

@rht I've added the Unit Tests on my person forked repo and I'm trying to test them. I'm seeing an issue in /mesa/space.py with the tuple where it is expected an from typing import Tuple . I believe it is some python versioning issue since I'm using Python 3.8.10. I'm not sure if I'm on the right path. What do you reckon I do?

ameyakhot avatar Jun 20 '24 02:06 ameyakhot

You should upgrade your Python. 3.8 is end of life (see https://endoflife.date/python). If you are on a personal machine, you should upgrade to 3.12.

rht avatar Jun 20 '24 02:06 rht

Understood. Will do so and get back to you. Thank you for the guidance!

ameyakhot avatar Jun 20 '24 03:06 ameyakhot