Verify resource cleanup using pytest fixture finalizer
Preconditions (2)
Step 1: Create a pytest fixture that sets up a resource (e.g., opens a file or creates a list)
Step 2: Use request.addfinalizer inside the fixture to add a cleanup function that releases the resource
Step 3: Write a test function that uses this fixture
Step 4: Run the test
Step 5: Verify that the cleanup function runs after the test completes
✅ Expected Result: The test passes and the cleanup function is executed after the test, releasing the resource properly