From caaed6b4b71b01cf6550ce038f6a11e9771a01fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irene=20L=C3=B3pez?= Date: Fri, 8 Dec 2023 15:54:25 +0000 Subject: [PATCH] test: output test_clumpstep_summary_stats results to temp dir --- tests/step/test_clump_step.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/step/test_clump_step.py b/tests/step/test_clump_step.py index 2d82453bb..d5f706f9c 100644 --- a/tests/step/test_clump_step.py +++ b/tests/step/test_clump_step.py @@ -1,6 +1,8 @@ """Test clump step.""" from __future__ import annotations +import tempfile +from pathlib import Path from typing import TYPE_CHECKING from otg.clump import ClumpStep @@ -12,13 +14,13 @@ class TestClumpStep: """Test clump step.""" - def test_clumpstep_summary_stats( - self: TestClumpStep, - session: Session, - ) -> None: - """Test clump step on summary statistics.""" - ClumpStep( - session=session, - input_path="tests/data_samples/GCST005523_chr18.parquet", - clumped_study_locus_path="GCST005523_chr18_clumped", - ) + def test_clumpstep_summary_stats(self, session: Session) -> None: + """Test clump step on summary statistics writes results to a temporary directory.""" + with tempfile.TemporaryDirectory() as temp_dir: + clumped_study_locus_path = Path(temp_dir, "GCST005523_chr18_clumped") + ClumpStep( + session=session, + input_path="tests/data_samples/GCST005523_chr18.parquet", + clumped_study_locus_path=str(clumped_study_locus_path), + ) + assert Path(clumped_study_locus_path).exists(), "Output directory exists."