aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/computations/test_wgcna.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-02-14 06:56:32 +0300
committerFrederick Muriuki Muriithi2022-02-17 06:37:30 +0300
commit74044f3c7985308b4996da3a52f91c5c20a19194 (patch)
treed86714b859b31cbbd1755522f8abd8eed16e321b /tests/unit/computations/test_wgcna.py
parent67f517aa0f44f55dc691ffd791bf22ef7af0b02c (diff)
downloadgenenetwork3-74044f3c7985308b4996da3a52f91c5c20a19194.tar.gz
Use pytest's "mark" feature to categorise tests
Use pytest's `mark` feature to explicitly categorise the tests and run them per category
Diffstat (limited to 'tests/unit/computations/test_wgcna.py')
-rw-r--r--tests/unit/computations/test_wgcna.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/unit/computations/test_wgcna.py b/tests/unit/computations/test_wgcna.py
index 5f23a86..3130374 100644
--- a/tests/unit/computations/test_wgcna.py
+++ b/tests/unit/computations/test_wgcna.py
@@ -2,6 +2,8 @@
from unittest import TestCase
from unittest import mock
+import pytest
+
from gn3.computations.wgcna import dump_wgcna_data
from gn3.computations.wgcna import compose_wgcna_cmd
from gn3.computations.wgcna import call_wgcna_script
@@ -10,6 +12,7 @@ from gn3.computations.wgcna import call_wgcna_script
class TestWgcna(TestCase):
"""test class for wgcna"""
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.wgcna.process_image")
@mock.patch("gn3.computations.wgcna.run_cmd")
@mock.patch("gn3.computations.wgcna.compose_wgcna_cmd")
@@ -95,6 +98,7 @@ class TestWgcna(TestCase):
self.assertEqual(results, expected_output)
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.wgcna.run_cmd")
@mock.patch("gn3.computations.wgcna.compose_wgcna_cmd")
@mock.patch("gn3.computations.wgcna.dump_wgcna_data")
@@ -117,6 +121,7 @@ class TestWgcna(TestCase):
self.assertEqual(call_wgcna_script(
"input_file.R", ""), expected_error)
+ @pytest.mark.unit_test
def test_compose_wgcna_cmd(self):
"""test for composing wgcna cmd"""
wgcna_cmd = compose_wgcna_cmd(
@@ -124,6 +129,7 @@ class TestWgcna(TestCase):
self.assertEqual(
wgcna_cmd, "Rscript ./scripts/wgcna.r /tmp/wgcna.json")
+ @pytest.mark.unit_test
@mock.patch("gn3.computations.wgcna.TMPDIR", "/tmp")
@mock.patch("gn3.computations.wgcna.uuid.uuid4")
def test_create_json_file(self, file_name_generator):