From f3b04b8f261a7345fa315ba48e37e831bed151fc Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Wed, 21 Sep 2022 19:56:02 +0100 Subject: [PATCH] Remove ``unittest.main()`` calls --- .../test_dynamic_tool_destination.py | 4 ---- test/unit/app/managers/base.py | 6 ------ test/unit/app/managers/test_CollectionManager.py | 8 -------- test/unit/app/managers/test_DatasetManager.py | 6 ------ test/unit/app/managers/test_HDAManager.py | 7 ------- test/unit/app/managers/test_HDCAManager.py | 7 ------- test/unit/app/managers/test_HistoryContentsManager.py | 6 ------ test/unit/app/managers/test_HistoryManager.py | 7 ------- test/unit/app/managers/test_UserManager.py | 6 ------ .../visualizations/plugins/test_VisualizationPlugin.py | 5 ----- .../visualizations/plugins/test_VisualizationsRegistry.py | 4 ---- .../datatypes/dataproviders/test_base_dataproviders.py | 4 ---- .../datatypes/dataproviders/test_line_dataproviders.py | 5 ----- test/unit/webapps/test_webapp_base.py | 4 ---- 14 files changed, 79 deletions(-) diff --git a/test/unit/app/jobs/dynamic_tool_destination/test_dynamic_tool_destination.py b/test/unit/app/jobs/dynamic_tool_destination/test_dynamic_tool_destination.py index 270314eaa61..b7dcf424b5d 100644 --- a/test/unit/app/jobs/dynamic_tool_destination/test_dynamic_tool_destination.py +++ b/test/unit/app/jobs/dynamic_tool_destination/test_dynamic_tool_destination.py @@ -1421,7 +1421,3 @@ class TestDynamicToolDestination(unittest.TestCase): assert dt.bytes_to_str("\t\t1000000") == "976.56 KB" assert dt.bytes_to_str("1000000000\n") == "953.67 MB" assert dt.bytes_to_str(1024, "fda") == "1.00 KB" - - -if __name__ == "__main__": - unittest.main() diff --git a/test/unit/app/managers/base.py b/test/unit/app/managers/base.py index 67320bbaa33..23de2593ac0 100644 --- a/test/unit/app/managers/base.py +++ b/test/unit/app/managers/base.py @@ -118,9 +118,3 @@ class CreatesCollectionsMixin: # src = 'ldda'#? identifier_list.append(dict(src=src, name=element.name, id=element.id)) return identifier_list - - -# ============================================================================= -if __name__ == "__main__": - # or more generally, nosetests test_resourcemanagers.py -s -v - unittest.main() diff --git a/test/unit/app/managers/test_CollectionManager.py b/test/unit/app/managers/test_CollectionManager.py index cc5bb8870f7..481c6c0d6af 100644 --- a/test/unit/app/managers/test_CollectionManager.py +++ b/test/unit/app/managers/test_CollectionManager.py @@ -1,8 +1,6 @@ #!/usr/bin/env python """ """ -import unittest - from galaxy import model from galaxy.managers.collections import DatasetCollectionManager from galaxy.managers.datasets import DatasetManager @@ -118,9 +116,3 @@ class DatasetCollectionManagerTestCase(BaseTestCase, CreatesCollectionsMixin): # self.log("should be able to set deleted") # self.log("should be able to set visible") # self.log("should be able to set tags") - - -# ============================================================================= -if __name__ == "__main__": - # or more generally, nosetests test_resourcemanagers.py -s -v - unittest.main() diff --git a/test/unit/app/managers/test_DatasetManager.py b/test/unit/app/managers/test_DatasetManager.py index cd830404f65..26b71a3428b 100644 --- a/test/unit/app/managers/test_DatasetManager.py +++ b/test/unit/app/managers/test_DatasetManager.py @@ -1,6 +1,5 @@ """ """ -import unittest from unittest import mock import sqlalchemy @@ -317,8 +316,3 @@ class DatasetSerializerTestCase(BaseTestCase): # DatasetAssociationSerializer, # DatasetAssociationDeserializer, # DatasetAssociationFilterParser - -# ============================================================================= -if __name__ == "__main__": - # or more generally, nosetests test_resourcemanagers.py -s -v - unittest.main() diff --git a/test/unit/app/managers/test_HDAManager.py b/test/unit/app/managers/test_HDAManager.py index f2ca4ee2dd4..bfcc67f1799 100644 --- a/test/unit/app/managers/test_HDAManager.py +++ b/test/unit/app/managers/test_HDAManager.py @@ -1,4 +1,3 @@ -import unittest from unittest import mock import sqlalchemy @@ -684,9 +683,3 @@ class HDAFilterParserTestCase(HDATestCase): # def test_data_type_filters( self ): # pass - - -# ============================================================================= -if __name__ == "__main__": - # or more generally, nosetests test_resourcemanagers.py -s -v - unittest.main() diff --git a/test/unit/app/managers/test_HDCAManager.py b/test/unit/app/managers/test_HDCAManager.py index 5b99a5df167..ad38d3b58fd 100644 --- a/test/unit/app/managers/test_HDCAManager.py +++ b/test/unit/app/managers/test_HDCAManager.py @@ -1,4 +1,3 @@ -import unittest from unittest import mock from galaxy.managers import ( @@ -102,9 +101,3 @@ class HDCASerializerTestCase(HDCATestCase): self.log("should be able to use keys on their own") serialized = serializer.serialize_to_view(item, keys=only_keys) self.assertKeys(serialized, only_keys) - - -# ============================================================================= -if __name__ == "__main__": - # or more generally, nosetests test_resourcemanagers.py -s -v - unittest.main() diff --git a/test/unit/app/managers/test_HistoryContentsManager.py b/test/unit/app/managers/test_HistoryContentsManager.py index 1878f7681e4..874134c6a42 100644 --- a/test/unit/app/managers/test_HistoryContentsManager.py +++ b/test/unit/app/managers/test_HistoryContentsManager.py @@ -2,7 +2,6 @@ """ import datetime import random -import unittest from sqlalchemy import ( column, @@ -373,8 +372,3 @@ class HistoryContentsFilterParserTestCase(HistoryAsContainerBaseTestCase): self.log("should error if wrong milliseconds format is used") self.assertRaises(ValueError, self.filter_parser.parse_date, "2009-02-13 18:13:00.") self.assertRaises(ValueError, self.filter_parser.parse_date, "2009-02-13 18:13:00.1234567") - - -if __name__ == "__main__": - # or more generally, nosetests test_resourcemanagers.py -s -v - unittest.main() diff --git a/test/unit/app/managers/test_HistoryManager.py b/test/unit/app/managers/test_HistoryManager.py index 2dd0b03fd62..d050db55d3d 100644 --- a/test/unit/app/managers/test_HistoryManager.py +++ b/test/unit/app/managers/test_HistoryManager.py @@ -1,6 +1,5 @@ """ """ -import unittest from unittest import mock import sqlalchemy @@ -940,9 +939,3 @@ class HistoryFiltersTestCase(BaseTestCase): # TODO: eq, ge, le # def test_ratings( self ): # pass - - -# ============================================================================= -if __name__ == "__main__": - # or more generally, nosetests test_resourcemanagers.py -s -v - unittest.main() diff --git a/test/unit/app/managers/test_UserManager.py b/test/unit/app/managers/test_UserManager.py index c48cb2b46c6..a7bf5f4ed71 100644 --- a/test/unit/app/managers/test_UserManager.py +++ b/test/unit/app/managers/test_UserManager.py @@ -3,7 +3,6 @@ User Manager testing. Executable directly using: python -m test.unit.managers.test_UserManager """ -import unittest from datetime import datetime from sqlalchemy import desc @@ -375,8 +374,3 @@ class AdminUserFilterParserTestCase(BaseTestCase): self.assertORMFilter(self.filter_parser.parse_filter("active", "eq", True)) self.assertORMFilter(self.filter_parser.parse_filter("disk_usage", "le", 500000.00)) self.assertORMFilter(self.filter_parser.parse_filter("disk_usage", "ge", 500000.00)) - - -# ============================================================================= -if __name__ == "__main__": - unittest.main() diff --git a/test/unit/app/visualizations/plugins/test_VisualizationPlugin.py b/test/unit/app/visualizations/plugins/test_VisualizationPlugin.py index d8b2b1fb4b6..3556145213c 100644 --- a/test/unit/app/visualizations/plugins/test_VisualizationPlugin.py +++ b/test/unit/app/visualizations/plugins/test_VisualizationPlugin.py @@ -1,8 +1,6 @@ """ Test lib/galaxy/visualization/plugins/plugin. """ -import unittest - from galaxy.app_unittest_utils import galaxy_mock from galaxy.util import clean_multiline_string from galaxy.visualization.plugins import ( @@ -158,6 +156,3 @@ class VisualizationsPlugin_TestCase(VisualizationsBase_TestCase): # ----------------------------------------------------------------------------- # TODO: config parser tests (in separate file) - -if __name__ == "__main__": - unittest.main() diff --git a/test/unit/app/visualizations/plugins/test_VisualizationsRegistry.py b/test/unit/app/visualizations/plugins/test_VisualizationsRegistry.py index d0c94534eb4..eb8072f1cd8 100644 --- a/test/unit/app/visualizations/plugins/test_VisualizationsRegistry.py +++ b/test/unit/app/visualizations/plugins/test_VisualizationsRegistry.py @@ -2,7 +2,6 @@ Test lib/galaxy/visualization/plugins/registry. """ import os -import unittest from galaxy.app_unittest_utils import galaxy_mock from galaxy.util import ( @@ -178,6 +177,3 @@ class VisualizationsRegistry_TestCase(VisualizationsBase_TestCase): # ----------------------------------------------------------------------------- # TODO: config parser tests (in separate file) - -if __name__ == "__main__": - unittest.main() diff --git a/test/unit/data/datatypes/dataproviders/test_base_dataproviders.py b/test/unit/data/datatypes/dataproviders/test_base_dataproviders.py index a05cabb157e..e5deb6770a1 100644 --- a/test/unit/data/datatypes/dataproviders/test_base_dataproviders.py +++ b/test/unit/data/datatypes/dataproviders/test_base_dataproviders.py @@ -395,7 +395,3 @@ class TempFileCache: log.debug("unlinking tmpfile: %s", tmpfile) os.unlink(tmpfile) self._content_dict = {} - - -if __name__ == "__main__": - unittest.main() diff --git a/test/unit/data/datatypes/dataproviders/test_line_dataproviders.py b/test/unit/data/datatypes/dataproviders/test_line_dataproviders.py index d77c8b774cc..091cc7f6e55 100644 --- a/test/unit/data/datatypes/dataproviders/test_line_dataproviders.py +++ b/test/unit/data/datatypes/dataproviders/test_line_dataproviders.py @@ -3,7 +3,6 @@ Unit tests for base DataProviders. .. seealso:: galaxy.datatypes.dataproviders.base """ import logging -import unittest from typing import Type from galaxy.datatypes.dataproviders import ( @@ -310,7 +309,3 @@ class Test_BlockDataProvider(test_base_dataproviders.Test_FilteredDataProvider): ) assert data == [{"id": "One", "seq": "ABCD"}, {"id": "Two", "seq": "ABCDEFGH"}] self.assertCounters(provider, 2, 2, 2) - - -if __name__ == "__main__": - unittest.main() diff --git a/test/unit/webapps/test_webapp_base.py b/test/unit/webapps/test_webapp_base.py index d2a94a28371..8b997756001 100644 --- a/test/unit/webapps/test_webapp_base.py +++ b/test/unit/webapps/test_webapp_base.py @@ -104,7 +104,3 @@ class GalaxyWebTransaction_Headers_TestCase(unittest.TestCase): trans.request.headers["Origin"] = "http://öbb.at" trans.set_cors_headers() assert trans.response.headers["access-control-allow-origin"] == "http://öbb.at" - - -if __name__ == "__main__": - unittest.main()