]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
test_report: Use a tmp_path fixture
authorZack Cerza <zack@redhat.com>
Thu, 11 Jul 2024 16:06:21 +0000 (10:06 -0600)
committerZack Cerza <zack@redhat.com>
Thu, 11 Jul 2024 22:48:31 +0000 (16:48 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/test/test_report.py

index 342cebdd0eed0666ee964f296af7bb4818f2da39..aeeadebf46bf90cab94fe219788b5327c363cd87 100644 (file)
@@ -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)