diff --git a/pytest.ini b/pytest.ini index 236a8204..14522dc7 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,3 +4,4 @@ testpaths = tests markers = pipeline_test: marks tests that execute complete pipelines + unit_test: marks unit tests diff --git a/tests/pipelines/test_pipelines.py b/tests/pipelines/test_pipelines.py index d70da09e..aea8ae43 100644 --- a/tests/pipelines/test_pipelines.py +++ b/tests/pipelines/test_pipelines.py @@ -47,6 +47,7 @@ class TestPipelineDirectories: """ A class that contains all the unit tests for the PipelineDirectories class.""" @staticmethod + @mark.unit_test def test_create(): """ Test the creation of a PipelineDirectories object """ @@ -67,6 +68,7 @@ def test_create(): assert pipeline_dir.output_dir == 'test_o' @staticmethod + @mark.unit_test def test_alternative_setters(): """ Test the alternatives setters of PipelineDirectories """ @@ -92,6 +94,7 @@ class TestPipelines: """ A class that contains all the unit tests for the Pipeline class.""" @staticmethod + @mark.unit_test def test_create(): """ Test the creation of a Pipeline object """ @@ -125,6 +128,7 @@ class TestUtils: """ A class that contains all the unit tests for the utils in module pipelines.""" @staticmethod + @mark.unit_test def test_utils(): """ Test the utils methods of PipelineRunner """ # 1 - Get number of not implemented pipelines diff --git a/tests/pipelines/test_team_2T6S.py b/tests/pipelines/test_team_2T6S.py index d46009ce..37ae3097 100644 --- a/tests/pipelines/test_team_2T6S.py +++ b/tests/pipelines/test_team_2T6S.py @@ -22,6 +22,7 @@ class TestPipelinesTeam2T6S: """ A class that contains all the unit tests for the PipelineTeam2T6S class.""" @staticmethod + @mark.unit_test def test_create(): """ Test the creation of a PipelineTeam2T6S object """ diff --git a/tests/test_runner.py b/tests/test_runner.py index b64db1d4..a4fea5c4 100644 --- a/tests/test_runner.py +++ b/tests/test_runner.py @@ -95,6 +95,7 @@ class TestPipelineRunner: """ A class that contains all the unit tests for the PipelineRunner class.""" @staticmethod + @mark.unit_test def test_create(): """ Test the creation of a PipelineRunner object """ @@ -120,6 +121,7 @@ def test_create(): runner.team_id = '08MQ' @staticmethod + @mark.unit_test def test_subjects(): """ Test the PipelineRunner features of building subject lists """ runner = PipelineRunner('2T6S') @@ -154,6 +156,7 @@ def test_subjects(): assert runner.subjects == ['022', '043', '045'] @staticmethod + @mark.unit_test def test_start_nok(): """ Test error cases for the start method of PipelineRunner """ # 1 - test starting a pipeline with no subject settings @@ -180,6 +183,7 @@ def test_start_nok(): runner.start() @staticmethod + @mark.unit_test def test_start_ok(): """ Test normal usecases of PipelineRunner """ # 1 - test starting a pipeline where everything ok diff --git a/tests/utils/test_correlation.py b/tests/utils/test_correlation.py index a0b461f0..25400d37 100644 --- a/tests/utils/test_correlation.py +++ b/tests/utils/test_correlation.py @@ -41,6 +41,7 @@ class TestUtilsCorrelation: """ A class that contains all the unit tests for the correlation module.""" @staticmethod + @mark.unit_test def test_mask_nan(): """ Test the mask_using_nan function """ # 1 - Create an image @@ -65,6 +66,7 @@ def test_mask_nan(): assert isnan(out_image_data[1, 1, 1]) @staticmethod + @mark.unit_test def test_mask_zeros(): """ Test the mask_using_zeros function """ # 1 - Create an image @@ -89,6 +91,7 @@ def test_mask_zeros(): assert isclose(out_image_data[1, 1, 1], 0.0) @staticmethod + @mark.unit_test def test_correlation(remove_temporary_files): """ Test the get_correlation_coefficient function, normal usecases """ # 1 - Create an image & save it to the working directory @@ -128,6 +131,7 @@ def test_correlation(remove_temporary_files): 0.08787495503274935) @staticmethod + @mark.unit_test def test_correlation_wrong(remove_temporary_files): """ Test the get_correlation_coefficient function, error cases """ # 1 - Create an image & save it to the working directory diff --git a/tests/utils/test_description.py b/tests/utils/test_description.py index 85c2ca22..c7553802 100644 --- a/tests/utils/test_description.py +++ b/tests/utils/test_description.py @@ -19,6 +19,7 @@ class TestUtilsDescription: """ A class that contains all the unit tests for the description module.""" @staticmethod + @mark.unit_test def test_creation(): """ Test the creation of a TeamDescription object """ @@ -34,6 +35,7 @@ def test_creation(): assert TeamDescription('2T6S') is not None @staticmethod + @mark.unit_test def test_arguments_properties(): """ Test the arguments and properties of a TeamDescription object """ diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index 627e54cc..203a0a23 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -17,6 +17,7 @@ class TestUtils: """ A class that contains all the unit tests for the utils module.""" @staticmethod + @mark.unit_test def test_get_all_participants(): """ Test the get_all_participants function """ participants_list = get_all_participants() @@ -26,6 +27,7 @@ def test_get_all_participants(): assert '123' in participants_list @staticmethod + @mark.unit_test def test_get_participants(): """ Test the get_participants function """