aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/db/test_datasets.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/db/test_datasets.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/db/test_datasets.py')
-rw-r--r--tests/unit/db/test_datasets.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/unit/db/test_datasets.py b/tests/unit/db/test_datasets.py
index 0b8c2fe..5b86db9 100644
--- a/tests/unit/db/test_datasets.py
+++ b/tests/unit/db/test_datasets.py
@@ -1,6 +1,7 @@
"""Tests for gn3/db/datasets.py"""
from unittest import mock, TestCase
+import pytest
from gn3.db.datasets import (
retrieve_dataset_name,
retrieve_group_fields,
@@ -11,6 +12,7 @@ from gn3.db.datasets import (
class TestDatasetsDBFunctions(TestCase):
"""Test cases for datasets functions."""
+ @pytest.mark.unit_test
def test_retrieve_dataset_name(self):
"""Test that the function is called correctly."""
for trait_type, thresh, trait_name, dataset_name, columns, table, expected in [
@@ -42,6 +44,7 @@ class TestDatasetsDBFunctions(TestCase):
table=table, cols=columns),
{"threshold": thresh, "name": dataset_name})
+ @pytest.mark.unit_test
def test_retrieve_probeset_group_fields(self):
"""
Test that the `group` and `group_id` fields are retrieved appropriately
@@ -65,6 +68,7 @@ class TestDatasetsDBFunctions(TestCase):
" AND ProbeSetFreeze.Name = %(name)s"),
{"name": trait_name})
+ @pytest.mark.unit_test
def test_retrieve_group_fields(self):
"""
Test that the group fields are set up correctly for the different trait
@@ -90,6 +94,7 @@ class TestDatasetsDBFunctions(TestCase):
trait_type, trait_name, dataset_info, db_mock),
expected)
+ @pytest.mark.unit_test
def test_retrieve_publish_group_fields(self):
"""
Test that the `group` and `group_id` fields are retrieved appropriately
@@ -112,6 +117,7 @@ class TestDatasetsDBFunctions(TestCase):
" AND PublishFreeze.Name = %(name)s"),
{"name": trait_name})
+ @pytest.mark.unit_test
def test_retrieve_geno_group_fields(self):
"""
Test that the `group` and `group_id` fields are retrieved appropriately