From 74044f3c7985308b4996da3a52f91c5c20a19194 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 14 Feb 2022 06:56:32 +0300 Subject: Use pytest's "mark" feature to categorise tests Use pytest's `mark` feature to explicitly categorise the tests and run them per category --- tests/unit/computations/test_parsers.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/unit/computations/test_parsers.py') diff --git a/tests/unit/computations/test_parsers.py b/tests/unit/computations/test_parsers.py index b51b0bf..f05f766 100644 --- a/tests/unit/computations/test_parsers.py +++ b/tests/unit/computations/test_parsers.py @@ -2,17 +2,21 @@ import unittest import os +import pytest + from gn3.computations.parsers import parse_genofile class TestParsers(unittest.TestCase): """Test cases for some various parsers""" + @pytest.mark.unit_test def test_parse_genofile_without_existing_file(self): """Assert that an error is raised if the genotype file is absent""" self.assertRaises(FileNotFoundError, parse_genofile, "/non-existent-file") + @pytest.mark.unit_test def test_parse_genofile_with_existing_file(self): """Test that a genotype file is parsed correctly""" samples = ["bxd1", "bxd2"] -- cgit v1.2.3