Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>I'd always assumed the point was to run these assertions at 'test-time', prior to distribution, and not have that code in the 'real' program.

That's the point of assertions, as they are usually not included in release mode builds in compiled languages. In Python you could just write an assert function that does nothing if some global "release" variable is set to true.

You only gain something from unit-tests if they test something that can't be equally well tested by writing the assertions into the regular code and running the software with typical input.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: