I have a unit test I'm running with a particular fixture. The fixture is pretty simple and looks like so:
@pytest.fixture
def patch_s3():
# Create empty bucket
bucket = s3_resource().create_bucket(Bucket=BUCKET)
bucket.objects.all().delete()
yield
bucket.objects.all().delete()
and the test isn't all that complicated either. Here is the signature for the test:
def test_task_asg(patch_s3, tmp_path, monkeypatch)
However, when I run pytest, I get the following error:
tests/test_task_asg.py:313: in <module>
@pytest.fixture
home/ubuntu/miniconda/envs/pipeline/lib/python3.7/site-packages/_pytest/fixtures.py:1150: in fixture
fixture_function
home/ubuntu/miniconda/envs/pipeline/lib/python3.7/site-packages/_pytest/fixtures.py:1011: in __call__
"fixture is being applied more than once to the same function"
E ValueError: fixture is being applied more than once to the same function
This is weird to me, as it seems to imply I'm somehow including patch_s3
more than once in test_task_asg
. What could be causing this?