More Halting, More Fire
Explore how to enhance your unit testing in Python by adding tests for invalid inputs such as zero and negative numbers when converting to Roman numerals. Understand how to catch exceptions using assertRaises, update your code conditions for input validation, and ensure your tests accurately reflect these scenarios for reliable error handling.
We'll cover the following...
We'll cover the following...
Along with testing numbers that are too large, you need to test numbers that are too small. As we noted in our functional requirements, Roman numerals cannot express 0 or negative numbers.
Well that’s not good. Let’s add tests for each of these conditions.
① The test_too_large() ...