""" shared pytest fixtures """ import shutil import tempfile import pytest @pytest.fixture def temp_dir(): # Create a temporary directory _temp_dir = tempfile.mkdtemp() yield _temp_dir # Clean up the directory after the test shutil.rmtree(_temp_dir)