AQA Test Automation Lesson 4, pytest fixture, setup(precondition), teardown(postcondition)

preview_player
Показать описание
Hi, thanks for viewing.

Tasks for better understanding:
Task 1
Write a class to test the database as shown in the video lesson, where methods "setup" and "teardown" are used to connect and disconnect from the database. Also, create several tests to check a value specified in "setup".
Task 2
Create a fixture named "numbers" that return a tuple of numbers (1, 2, 3, 4, 5). Use this fixture in two tests to check the sum of numbers in the tuple and the presence of a specific number.
- Write the fixture "numbers" that returns a tuple of numbers.
- Write the test "test_addition" to check if the sum of numbers in the tuple is equal to 15.
- Write the test "test_found" to check if the number 5 is in the tuple.
Task 3
Create a test suite that uses a single fixture to prepare data before each test and clean up after it.

Test based on this lesson:
Рекомендации по теме