Python Testing and Debugging
Python Testing and Debugging - Important Points
6. | Which assertion method is used to test for equality in Python? |
---|
A. assertEqual()
B. assertNotEqual()
C. assertTrue()
D. assertFalse()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
7. | Which module is used for logging in Python? |
---|
A. logging
B. unittest
C. traceback
D. sys
View Answer Discuss Work SpaceAnswer: option a
Explanation:
8. | Which command is used to run a single test case in Python? |
---|
A. python -m unittest test_case.py
B. python -m unittest discover
C. python -m unittest test_case.TestClass.test_method
D. python -m unittest test_case.TestClass
View Answer Discuss Work SpaceAnswer: option c
Explanation:
9. | Which tool is used for profiling Python code? |
---|
A. cProfile
B. unittest
C. logging
D. pdb
View Answer Discuss Work SpaceAnswer: option a
Explanation:
10. | What is a breakpoint in Python? |
---|
A. A location in the code where the program stops running
B. A location in the code where the program starts running
C. A location in the code where the program outputs a message
D. A location in the code where the program skips a line
View Answer Discuss Work SpaceAnswer: option a
Explanation: