Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions