aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test_db_utils.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/test_db_utils.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/test_db_utils.py')
-rw-r--r--tests/unit/test_db_utils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/unit/test_db_utils.py b/tests/unit/test_db_utils.py
index 0f2de9e..dd0cd5d 100644
--- a/tests/unit/test_db_utils.py
+++ b/tests/unit/test_db_utils.py
@@ -3,6 +3,7 @@
from unittest import TestCase
from unittest import mock
+import pytest
from types import SimpleNamespace
from gn3.db_utils import database_connector
@@ -12,6 +13,7 @@ from gn3.db_utils import parse_db_url
class TestDatabase(TestCase):
"""class contains testd for db connection functions"""
+ @pytest.mark.unit_test
@mock.patch("gn3.db_utils.mdb")
@mock.patch("gn3.db_utils.parse_db_url")
def test_database_connector(self, mock_db_parser, mock_sql):
@@ -28,6 +30,7 @@ class TestDatabase(TestCase):
self.assertIsInstance(
results, tuple, "database not created successfully")
+ @pytest.mark.unit_test
@mock.patch("gn3.db_utils.SQL_URI",
"mysql://username:4321@localhost/test")
def test_parse_db_url(self):