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/test_heatmaps.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/test_heatmaps.py')
-rw-r--r-- | tests/unit/test_heatmaps.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit/test_heatmaps.py b/tests/unit/test_heatmaps.py index a88341b..8781d6f 100644 --- a/tests/unit/test_heatmaps.py +++ b/tests/unit/test_heatmaps.py @@ -1,6 +1,7 @@ """Module contains tests for gn3.heatmaps.heatmaps""" from unittest import TestCase +import pytest from numpy.testing import assert_allclose from gn3.heatmaps import ( @@ -27,6 +28,7 @@ slinked = ( class TestHeatmap(TestCase): """Class for testing heatmap computation functions""" + @pytest.mark.unit_test def test_cluster_traits(self): # pylint: disable=R0201 """ Test that the clustering is working as expected. @@ -76,11 +78,13 @@ class TestHeatmap(TestCase): 1.7413442197913358, 0.33370067057028485, 1.3256191648260216, 0.0))) + @pytest.mark.unit_test def test_compute_heatmap_order(self): """Test the orders.""" self.assertEqual( compute_traits_order(slinked), (0, 2, 1, 7, 5, 9, 3, 6, 8, 4)) + @pytest.mark.unit_test def test_retrieve_samples_and_values(self): """Test retrieval of samples and values.""" for orders, slist, tdata, expected in [ @@ -106,6 +110,7 @@ class TestHeatmap(TestCase): self.assertEqual( retrieve_samples_and_values(orders, slist, tdata), expected) + @pytest.mark.unit_test def test_get_lrs_from_chr(self): """Check that function gets correct LRS values""" for trait, chromosome, expected in [ @@ -120,6 +125,7 @@ class TestHeatmap(TestCase): with self.subTest(trait=trait, chromosome=chromosome): self.assertEqual(get_lrs_from_chr(trait, chromosome), expected) + @pytest.mark.unit_test def test_process_traits_data_for_heatmap(self): """Check for correct processing of data for heatmap generation.""" self.assertEqual( @@ -132,6 +138,7 @@ class TestHeatmap(TestCase): [[0.5, 0.579, 0.5], [0.5, 0.5, 0.5]]]) + @pytest.mark.unit_test def test_get_loci_names(self): """Check that loci names are retrieved correctly.""" for organised, expected in ( |