Python Testing and Debugging
Python Testing and Debugging - Important Points
21. | Which module in Python provides support for unit testing? |
---|
A. unittest
B. pytest
C. doctest
D. all of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation:
22. | What is a mock object in Python? |
---|
A. An object that simulates the behavior of a real object in a controlled way
B. An object that is used to bypass security measures in a program
C. An object that is used to test network connections
D. An object that is used to generate random data for testing
View Answer Discuss Work SpaceAnswer: option a
Explanation:
23. | What is code coverage in Python testing? |
---|
A. The percentage of code that is executed during testing
B. The amount of time it takes to run a test suite
C. The number of test cases that are run during testing
D. The number of bugs that are found during testing
View Answer Discuss Work SpaceAnswer: option a
Explanation:
24. | What is a breakpoint in Python debugging? |
---|
A. A point in the code where execution is paused to allow for inspection
B. A point in the code where execution is terminated
C. A point in the code where a specific action is triggered
D. A point in the code where an error is expected to occur
View Answer Discuss Work SpaceAnswer: option a
Explanation:
25. | Which tool in Python can be used for profiling and optimizing code performance? |
---|
A. cProfile
B. timeit
C. memory_profiler
D. all of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation: