beeware / batavia

A JavaScript implementation of the Python virtual machine.
http://pybee.org/batavia
Other
1.39k stars 425 forks source link

Prevent unintentional exceptions constituting a passing test. #795

Closed martica closed 5 years ago

martica commented 5 years ago

This add a default test to assertCodeExecution that no exception was thrown and not caught within the test code, and fixes the many places where this was happening.

There is an allow_exceptions parameter to use for cases where the test is specifically testing that exceptions can be thrown and not caught.

This is a solution to #792.

PR Checklist:

martica commented 5 years ago

Good call. I think the size of utils.py made me want some more organization. I didn't file an issue, but i did put breaking up utils.py on my own list earlier this week. :)