From: Zack Cerza Date: Thu, 11 Jul 2024 16:06:21 +0000 (-0600) Subject: test_report: Use a tmp_path fixture X-Git-Tag: 1.2.0~17^2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e22d43db64d6c44aaca8d7f6323b8a7f8c0ca627;p=teuthology.git test_report: Use a tmp_path fixture Signed-off-by: Zack Cerza --- diff --git a/teuthology/test/test_report.py b/teuthology/test/test_report.py index 342cebdd0e..aeeadebf46 100644 --- a/teuthology/test/test_report.py +++ b/teuthology/test/test_report.py @@ -1,12 +1,20 @@ -import yaml import json +import pytest +import yaml + from teuthology.test import fake_archive from teuthology import report +@pytest.fixture(autouse=True) +def archive(tmp_path): + return fake_archive.FakeArchive(archive_base=str(tmp_path)) + + class TestSerializer(object): - def setup_method(self): - self.archive = fake_archive.FakeArchive() + @pytest.fixture(autouse=True) + def setup_method(self, archive): + self.archive = archive self.archive.setup() self.archive_base = self.archive.archive_base self.reporter = report.ResultsReporter(archive_base=self.archive_base)