Skip to content

Commit 8bfb13b

Browse files
committed
add env mock
1 parent 56c7125 commit 8bfb13b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

v03_pipeline/lib/tasks/write_remapped_and_subsetted_callset_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import shutil
2+
from unittest.mock import Mock, patch
23

34
import hail as hl
45
import luigi.worker
@@ -83,7 +84,6 @@ def test_write_remapped_and_subsetted_callset_task(
8384
project_remap_path=TEST_REMAP,
8485
project_pedigree_path=TEST_PEDIGREE_3,
8586
skip_validation=True,
86-
skip_check_sex_and_relatedness=False,
8787
)
8888
worker.add(wrsc_task)
8989
worker.run()
@@ -104,9 +104,12 @@ def test_write_remapped_and_subsetted_callset_task(
104104
],
105105
)
106106

107+
@patch('v03_pipeline.lib.tasks.write_remapped_and_subsetted_callset.Env')
107108
def test_write_remapped_and_subsetted_callset_task_failed_sex_check_family(
108109
self,
110+
mock_env: Mock,
109111
) -> None:
112+
mock_env.CHECK_SEX_AND_RELATEDNESS = True
110113
worker = luigi.worker.Worker()
111114
wrsc_task = WriteRemappedAndSubsettedCallsetTask(
112115
reference_genome=ReferenceGenome.GRCh38,
@@ -117,7 +120,6 @@ def test_write_remapped_and_subsetted_callset_task_failed_sex_check_family(
117120
project_remap_path=TEST_REMAP,
118121
project_pedigree_path=TEST_PEDIGREE_4,
119122
skip_validation=True,
120-
skip_check_sex_and_relatedness=False,
121123
)
122124
worker.add(wrsc_task)
123125
worker.run()

0 commit comments

Comments
 (0)