diff options
author | Frederick Muriuki Muriithi | 2022-02-14 06:56:32 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2022-02-17 06:37:30 +0300 |
commit | 74044f3c7985308b4996da3a52f91c5c20a19194 (patch) | |
tree | d86714b859b31cbbd1755522f8abd8eed16e321b /tests/unit/computations/test_gemma.py | |
parent | 67f517aa0f44f55dc691ffd791bf22ef7af0b02c (diff) | |
download | genenetwork3-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_gemma.py')
-rw-r--r-- | tests/unit/computations/test_gemma.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/unit/computations/test_gemma.py b/tests/unit/computations/test_gemma.py index 73dd5eb..b36a93e 100644 --- a/tests/unit/computations/test_gemma.py +++ b/tests/unit/computations/test_gemma.py @@ -1,7 +1,9 @@ """Test cases for procedures defined in computations.gemma""" import unittest - from unittest import mock + +import pytest + from gn3.computations.gemma import generate_gemma_cmd from gn3.computations.gemma import generate_hash_of_string from gn3.computations.gemma import generate_pheno_txt_file @@ -9,6 +11,7 @@ from gn3.computations.gemma import generate_pheno_txt_file class TestGemma(unittest.TestCase): """Test cases for computations.gemma module""" + @pytest.mark.unit_test def test_generate_pheno_txt_file(self): """Test that the pheno text file is generated correctly""" open_mock = mock.mock_open() @@ -26,11 +29,13 @@ class TestGemma(unittest.TestCase): mock.call("BXD07 438.700\n") ]) + @pytest.mark.unit_test def test_generate_hash_of_string(self): """Test that a string is hashed correctly""" self.assertEqual(generate_hash_of_string("I^iQP&TlSR^z"), "hMVRw8kbEp49rOmoIkhMjA") + @pytest.mark.unit_test @mock.patch("gn3.computations.gemma.get_hash_of_files") def test_compute_k_values_without_loco(self, mock_get_hash): """Test computing k values without loco""" @@ -52,6 +57,7 @@ class TestGemma(unittest.TestCase): "-gk > /tmp/my-token/my-hash-output.json") }) + @pytest.mark.unit_test @mock.patch("gn3.computations.gemma.get_hash_of_files") def test_generate_gemma_cmd_with_loco(self, mock_get_hash): """Test computing k values with loco""" |