Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Suppose the following is the contents of a file called check_int.py. import unittest def check_int(k): Checks if k is an integer, raises an exception if
Suppose the following is the contents of a file called check_int.py. import unittest def check_int(k): Checks if k is an integer, raises an exception if it is not. if type(k) != int: raise TypeError("k must be an integer") else: return k class TestCheckInt(unittest. Test Case): def test_is_int(self): k = 1 self.assert IsNone(check_int(k)) def test_is_float(self): k = 1.0 with self.assertRaises(TypeError): check_int(k) if 1 _name__ == __main__': unittest.main() Assuming that we have navigated to the same directory as check_int.py in the terminal, how many failures are reported when we run the following command in the terminal: python check_int.py? 2 No answer text provided. 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started