brownplt / lambda-py

Other
58 stars 10 forks source link

___assertFoo functions should raise AssertionError, not racket-land exception #31

Closed dbp closed 11 years ago

dbp commented 11 years ago

___assertEqual(1, 2) should raise an AssertionError, because it should be catchable. ie,

try:
    ___assertEqual(1,2)
except AssertionError:
    pass

Note that this is how unittest works, which is what the ___assertFoo functions are copying:

import unittest
class TestFunctions(unittest.TestCase):
    def test_foo(self):
        try:
            self.assertEqual(True, False)
        except AssertionError:
            pass
if __name__ == '__main__':
    unittest.main()
amtriathlon commented 11 years ago

https://github.com/brownplt/lambda-py/commit/ec625986740af5598de81c80a1570886699e82f4