Overview
This course aims to teach learners how to simplify and improve their tests by utilizing fixtures. The course covers the problems fixtures solve, their usage, and how they can enhance the testing process. Participants will learn how to create and use common abstractions to be shared among tests, manipulate paths in settings, and understand fixture dependencies. The teaching method includes examples, code demonstrations, and explanations in a notebook. This course is intended for individuals already familiar with pytest and testing but have little to no experience with fixtures.
Syllabus
- Intro
- Examples and explanation in a notebook
- First fixture example in code
- Discuss mechanics using tmppath fixture
- Use fixtures to manipulate paths in settings
- Use pytest argument to show fixtures in use
- Use PyCharm to move around fixtures
- Custom fixture
- Monkeypatching
- Fixture dependencies and usefixtures
- How are fixtures looked up?
- Fixture gotchas
- Fixture scopes
- Parametrizing fixtures
- Parametrizing tests
Taught by
PyCharm by JetBrains