PyTest - Fixtures
Identify the error in this fixture code and how to fix it:
import pytest
@pytest.fixture
def resource():
setup = open('file.txt')
yield setup
setup.close()