2 - Using pytest for Advanced Testing
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
Practice Questions
Test your understanding with targeted questions
What is the purpose of pytest?
💡 Hint: Think of the advantages over traditional testing frameworks.
How do you define a test function in pytest?
💡 Hint: Remember the naming convention?
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What streamlining feature does pytest offer compared to unittest?
💡 Hint: Think about how models work in unittest versus pytest.
True or False: You can write functions as tests in pytest without needing to define a class.
💡 Hint: Consider how you would normally structure tests in other frameworks.
1 more question available
Challenge Problems
Push your limits with advanced challenges
Create a pytest test suite that includes multiple tests for a calculator module with functions like add, subtract, multiply, and divide. Use fixtures for setup and parameterized tests for inputs.
💡 Hint: Think about how you would organize your functions and use `@pytest.mark.parametrize` for different inputs.
Research a pytest plugin of your choice. Write a summary describing its functionalities and how it can improve the testing workflow.
💡 Hint: Look for plugins that enhance output reports or facilitate test execution.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.